adding user setting for rpe warnings
This commit is contained in:
@@ -932,6 +932,9 @@ class Rower(models.Model):
|
||||
getimportantemails = models.BooleanField(default=True,
|
||||
verbose_name='Get Important Emails')
|
||||
|
||||
get_rpe_warnings = models.BooleanField(default=True,
|
||||
verbose_name='Get missing RPE warnings')
|
||||
|
||||
share_course_results = models.BooleanField(default=True,
|
||||
verbose_name='Share Course Results')
|
||||
|
||||
@@ -4587,6 +4590,7 @@ class AccountRowerForm(ModelForm):
|
||||
'adaptiveclass',
|
||||
'getemailnotifications',
|
||||
'getimportantemails',
|
||||
'get_rpe_warnings',
|
||||
'share_course_results',
|
||||
'defaulttimezone', 'showfavoritechartnotes',
|
||||
'fav_analysis',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user