Private
Public Access
1
0
This commit is contained in:
2024-01-10 19:11:21 +01:00
parent 0c12bec57e
commit a23f49cc6e
3 changed files with 7 additions and 2 deletions

View File

@@ -2809,7 +2809,10 @@ def history_view_data(request, userid=0):
ddf = dataprep.clean_df_stats(ddf, workstrokesonly=False,
ignoreadvanced=True)
ddict['hrmean'] = int(wavg(ddf, 'hr', 'deltat'))
try:
ddict['hrmean'] = int(wavg(ddf, 'hr', 'deltat'))
except (KeyError, ValueError, AttributeError): # pragma: no cover
ddict['hrmean'] = 0
try:
ddict['hrmax'] = ddf['hr'].max().astype(int)
except (KeyError, ValueError, AttributeError): # pragma: no cover