Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2022-09-15 21:54:59 +02:00
parent 6beae2ca37
commit 5739da52f5
2 changed files with 21 additions and 4 deletions

View File

@@ -100,8 +100,22 @@ def alert_get_stats(alert, nperiod=0): # pragma: no cover
boattype=alert.boattype)
ids = [w.id for w in workouts]
df = getsmallrowdata_db(columns, ids=ids, doclean=True,
workstrokesonly=workstrokesonly)
try:
df = getsmallrowdata_db(columns, ids=ids, doclean=True,
workstrokesonly=workstrokesonly)
except:
return {
'workouts': workouts.count(),
'startdate': startdate,
'enddate': enddate,
'nr_strokes': 0,
'nr_strokes_qualifying': 0,
'percentage': 0,
'nperiod': nperiod,
'median': 0,
'median_q': 0,
'standard_dev': 0,
}
if df.empty:
return {