Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2022-09-19 20:11:01 +02:00
parent 54aa41548a
commit d4f501d20c

View File

@@ -3529,6 +3529,7 @@ class Workout(models.Model):
workouttype = self.workouttype workouttype = self.workouttype
if workouttype != 'water': if workouttype != 'water':
try:
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format( stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
d=date.strftime('%Y-%m-%d'), d=date.strftime('%Y-%m-%d'),
n=name, n=name,
@@ -3538,17 +3539,22 @@ class Workout(models.Model):
ownerfirst=ownerfirst, ownerfirst=ownerfirst,
ownerlast=ownerlast, ownerlast=ownerlast,
) )
except ValueError:
stri = 'workout'
else: else:
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format( try:
stri = u'{d} {n} {dist}m {duration} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
d=date.strftime('%Y-%m-%d'), d=date.strftime('%Y-%m-%d'),
n=name, n=name,
dist=distance, dist=distance,
duration=duration, duration=duration.strftime("%H:%M:%S"),
workouttype=workouttype, workouttype=workouttype,
boattype=boattype, boattype=boattype,
ownerfirst=ownerfirst, ownerfirst=ownerfirst,
ownerlast=ownerlast, ownerlast=ownerlast,
) )
except ValueError:
stri = 'workout'
return stri return stri