fix
This commit is contained in:
@@ -3529,26 +3529,32 @@ class Workout(models.Model):
|
||||
workouttype = self.workouttype
|
||||
|
||||
if workouttype != 'water':
|
||||
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
|
||||
d=date.strftime('%Y-%m-%d'),
|
||||
n=name,
|
||||
dist=distance,
|
||||
duration=duration.strftime("%H:%M:%S"),
|
||||
workouttype=workouttype,
|
||||
ownerfirst=ownerfirst,
|
||||
ownerlast=ownerlast,
|
||||
)
|
||||
try:
|
||||
stri = u'{d} {n} {dist}m {duration} {workouttype} {ownerfirst} {ownerlast}'.format(
|
||||
d=date.strftime('%Y-%m-%d'),
|
||||
n=name,
|
||||
dist=distance,
|
||||
duration=duration.strftime("%H:%M:%S"),
|
||||
workouttype=workouttype,
|
||||
ownerfirst=ownerfirst,
|
||||
ownerlast=ownerlast,
|
||||
)
|
||||
except ValueError:
|
||||
stri = 'workout'
|
||||
else:
|
||||
stri = u'{d} {n} {dist}m {duration:%H:%M:%S} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
|
||||
d=date.strftime('%Y-%m-%d'),
|
||||
n=name,
|
||||
dist=distance,
|
||||
duration=duration,
|
||||
workouttype=workouttype,
|
||||
boattype=boattype,
|
||||
ownerfirst=ownerfirst,
|
||||
ownerlast=ownerlast,
|
||||
)
|
||||
try:
|
||||
stri = u'{d} {n} {dist}m {duration} {workouttype} {boattype} {ownerfirst} {ownerlast}'.format(
|
||||
d=date.strftime('%Y-%m-%d'),
|
||||
n=name,
|
||||
dist=distance,
|
||||
duration=duration.strftime("%H:%M:%S"),
|
||||
workouttype=workouttype,
|
||||
boattype=boattype,
|
||||
ownerfirst=ownerfirst,
|
||||
ownerlast=ownerlast,
|
||||
)
|
||||
except ValueError:
|
||||
stri = 'workout'
|
||||
|
||||
return stri
|
||||
|
||||
|
||||
Reference in New Issue
Block a user