Private
Public Access
1
0

adding user setting for rpe warnings

This commit is contained in:
Sander Roosendaal
2022-11-27 10:17:12 +01:00
parent b4973d8f52
commit e7d5622d7b
3 changed files with 9 additions and 2 deletions

View File

@@ -491,6 +491,7 @@ def rower_edit_view(request, rowerid=0, userid=0, message=""):
showfavoritechartnotes = cd['showfavoritechartnotes']
getemailnotifications = cd['getemailnotifications']
getimportantemails = cd['getimportantemails']
get_rpe_warnings = cd['get_rpe_warnings']
share_course_results = cd['share_course_results']
defaulttimezone = cd['defaulttimezone']
fav_analysis = cd['fav_analysis']
@@ -522,6 +523,7 @@ def rower_edit_view(request, rowerid=0, userid=0, message=""):
r.sex = sex
r.birthdate = birthdate
r.autojoin = autojoin
r.get_rpe_warnings = cd['get_rpe_warnings']
r.emailalternatives = emailalternatives
r.fav_analysis = fav_analysis
r.usersmooth = usersmooth

View File

@@ -2206,9 +2206,10 @@ def workouts_view(request, message='', successmessage='',
'%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
norpecount = len([w for w in workouts if w.rpe==0])
if norpecount:
if norpecount and r.get_rpe_warnings:
messages.info(request,'You have workouts with no RPE value set. \
Click <a href="/rowers/workouts/setrpe">here</a> to update them.')
Click <a href="/rowers/workouts/setrpe">here</a> to update them. \
You can switch off this warning in <a href="/rowers/me/edit">settings</a>.')
return render(request, 'list_workouts.html',
{'workouts': workouts,