Private
Public Access
1
0

adding more data filtering exception catching

This commit is contained in:
2024-04-13 11:46:08 +02:00
parent 4b7ab5f923
commit ee0229a43d
4 changed files with 34 additions and 8 deletions

View File

@@ -2482,11 +2482,18 @@ def history_view_data(request, userid=0):
meters, hours, minutes, seconds = get_totals(a_workouts)
totalseconds = 3600 * hours + 60 * minutes + seconds
ddf = getsmallrowdata_pl(columns, ids=[w.id for w in a_workouts])
if ddf.is_empty():
totalscript = ""
totaldiv = "No data"
try:
ddf = ddf.with_columns(pl.col("time").diff().clip(lower_bound=0).alias("deltat"))
except KeyError:
pass
except ColumnNotFoundError:
totalscript = ""
totaldiv = "No data"
ddf = dataprep.clean_df_stats_pl(ddf, workstrokesonly=True,
ignoreadvanced=True)