Hi,

2011/8/31 Nathan Jones <nat...@ncjones.com>:
>>>>  File "/usr/lib/python2.7/site-packages/pytrainer/stats.py", line 55,
>>>> in get_stats
>>>>    sport = self._sport_service.get_sport(r['sport'])
>>>>  File "/usr/lib/python2.7/site-packages/pytrainer/sport.py", line
>>>> 148, in get_sport
>>>>    raise ValueError("Sport id cannot be None")
>>>> ValueError: Sport id cannot be None
>>>
>>> This would happen if a record was created without having a sport
>>> associated with it. I don't know how that can happen. Can you describe
>>> the steps required to reproduce this scenario?
>>
>> Basically I take gpx file attached in ticket 137
>> (https://sourceforge.net/apps/trac/pytrainer/raw-attachment/ticket/137/serSession.gpx.bz2)
>> and try to import it using unified import (File->Import) (I am aware
>> clickpath in #137 is a different one). Then something is not working
>> fine because activity doesn't show up, restart pytrainer and then
>> mentioned error triggers.
>
> Thanks for that. I can reproduce this issue now - the GPX file import
> operation is incorrectly setting the record's sport to None and the
> new sport service is rejecting the invalid sport id when it is being
> loaded for the totals view.

As far as I have seen in GPX class file, it is a bit of a mess
regarding different ways to import files. Unified import iniative
looks great but unfortunately is not finished yet. I don't remember
well initial idea from John, but I think it makes sense that all
imports (which imply submitting and parsing a file) should be done
through "unified import" and keep "New import" wizard for activities
without xml based files. This would avoid misunderstandings as long as
we provide just one way to do things (with file -> "Import"; without
file -> "New"), but need changes in "New import" logic, fortunately
most of them can be done just removing (duplicated) logic.

> The correct fix for this is to prevent records from being stored
> without a valid sport id and to provide a data migration script for
> existing invalid records. This is non-trivial so for the 1.9.0 release
> I will just do a workaround so the totals view ignores records without
> a sport id.

Great, thanks!.

> The full fix will be done as part of the activity service in the next version.

Sounds perfect.

Regards,

David

PS: I didn't send out any "official" message announcing freeze for
1.9.0, but I assume current email can be understood as it. Please
update localization files!

PS2: I have changed thread title to gain some attention on this topic

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Pytrainer-devel mailing list
Pytrainer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytrainer-devel

Reply via email to