>>>  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.

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.

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

 - Nathan

------------------------------------------------------------------------------
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