diff --git a/fittrackee/workouts/models.py b/fittrackee/workouts/models.py index 08f8cb89..7afb8897 100644 --- a/fittrackee/workouts/models.py +++ b/fittrackee/workouts/models.py @@ -200,21 +200,21 @@ class Workout(BaseModel): 'creation_date': self.creation_date, 'modification_date': self.modification_date, 'workout_date': self.workout_date, - 'duration': str(self.duration) if self.duration else None, + 'duration': None if self.duration is None else str(self.duration), 'pauses': str(self.pauses) if self.pauses else None, - 'moving': str(self.moving) if self.moving else None, - 'distance': float(self.distance) if self.distance else None, - 'min_alt': float(self.min_alt) if self.min_alt else None, - 'max_alt': float(self.max_alt) if self.max_alt else None, - 'descent': float(self.descent) - if self.descent is not None - else None, - 'ascent': float(self.ascent) if self.ascent is not None else None, + 'moving': None if self.moving is None else str(self.moving), + 'distance': ( + None if self.distance is None else float(self.distance) + ), + 'min_alt': None if self.min_alt is None else float(self.min_alt), + 'max_alt': None if self.max_alt is None else float(self.max_alt), + 'descent': None if self.descent is None else float(self.descent), + 'ascent': None if self.ascent is None else float(self.ascent), 'max_speed': ( - float(self.max_speed) if self.max_speed is not None else None + None if self.max_speed is None else float(self.max_speed) ), 'ave_speed': ( - float(self.ave_speed) if self.ave_speed is not None else None + None if self.ave_speed is None else float(self.ave_speed) ), 'records': [record.serialize() for record in self.records], 'segments': [segment.serialize() for segment in self.segments], diff --git a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutData.vue b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutData.vue index 43865567..1a118481 100644 --- a/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutData.vue +++ b/fittrackee_client/src/components/Workout/WorkoutDetail/WorkoutData.vue @@ -12,7 +12,7 @@ {{ workoutObject.duration }}) -
+