fix
This commit is contained in:
@@ -3697,13 +3697,22 @@ class Workout(models.Model):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
||||||
|
try:
|
||||||
|
dates = self.date.strftime('%Y-%m-%d')
|
||||||
|
except AttributeError:
|
||||||
|
dates = ''
|
||||||
|
try:
|
||||||
|
durations = self.duration.strftime("%H:%M:%S"),
|
||||||
|
except AttributeError:
|
||||||
|
durations = ''
|
||||||
|
|
||||||
elements = dict(
|
elements = dict(
|
||||||
date = self.date.strftime('%Y-%m-%d'),
|
date = dates,
|
||||||
name = self.name,
|
name = self.name,
|
||||||
distance = str(self.distance)+'m',
|
distance = str(self.distance)+'m',
|
||||||
ownerfirst = self.user.user.first_name,
|
ownerfirst = self.user.user.first_name,
|
||||||
ownerlast = self.user.user.last_name,
|
ownerlast = self.user.user.last_name,
|
||||||
duration = self.duration.strftime("%H:%M:%S"),
|
duration = durations,
|
||||||
boattype = self.boattype,
|
boattype = self.boattype,
|
||||||
workouttype = self.workouttype,
|
workouttype = self.workouttype,
|
||||||
seatnumber = 'seat '+str(self.seatnumber),
|
seatnumber = 'seat '+str(self.seatnumber),
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -2229,7 +2229,8 @@ def history_view_data(request, userid=0):
|
|||||||
df = df.with_columns(pl.col('time').diff().clip(lower_bound=0).alias("deltat"))
|
df = df.with_columns(pl.col('time').diff().clip(lower_bound=0).alias("deltat"))
|
||||||
except KeyError: # pragma: no cover
|
except KeyError: # pragma: no cover
|
||||||
pass
|
pass
|
||||||
|
except ColumnNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
totalmeters, totalhours, totalminutes, totalseconds = get_totals(
|
totalmeters, totalhours, totalminutes, totalseconds = get_totals(
|
||||||
g_workouts)
|
g_workouts)
|
||||||
|
|||||||
Reference in New Issue
Block a user