Changeset 6211162 in OpenWorkouts-current for ow/models/workout.py


Ignore:
Timestamp:
Oct 13, 2019, 4:45:30 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
8340661
Parents:
93b23a6
Message:

Put duration/distance on the workout hash only if those values are there

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/models/workout.py

    r93b23a6 r6211162  
    145145            hashed += str(self.owner.uid)
    146146        hashed += self.start.strftime('%Y%m%d%H%M%S')
    147         hashed += str(self.duration.seconds)
    148         hashed += str(self.distance)
     147        if self.duration is not None:
     148            hashed += str(self.duration.seconds)
     149        if self.distance is not None:
     150            hashed += str(self.distance)
    149151        return hashed
    150152
Note: See TracChangeset for help on using the changeset viewer.