adding user setting for rpe warnings
This commit is contained in:
@@ -932,6 +932,9 @@ class Rower(models.Model):
|
|||||||
getimportantemails = models.BooleanField(default=True,
|
getimportantemails = models.BooleanField(default=True,
|
||||||
verbose_name='Get Important Emails')
|
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,
|
share_course_results = models.BooleanField(default=True,
|
||||||
verbose_name='Share Course Results')
|
verbose_name='Share Course Results')
|
||||||
|
|
||||||
@@ -4587,6 +4590,7 @@ class AccountRowerForm(ModelForm):
|
|||||||
'adaptiveclass',
|
'adaptiveclass',
|
||||||
'getemailnotifications',
|
'getemailnotifications',
|
||||||
'getimportantemails',
|
'getimportantemails',
|
||||||
|
'get_rpe_warnings',
|
||||||
'share_course_results',
|
'share_course_results',
|
||||||
'defaulttimezone', 'showfavoritechartnotes',
|
'defaulttimezone', 'showfavoritechartnotes',
|
||||||
'fav_analysis',
|
'fav_analysis',
|
||||||
|
|||||||
@@ -491,6 +491,7 @@ def rower_edit_view(request, rowerid=0, userid=0, message=""):
|
|||||||
showfavoritechartnotes = cd['showfavoritechartnotes']
|
showfavoritechartnotes = cd['showfavoritechartnotes']
|
||||||
getemailnotifications = cd['getemailnotifications']
|
getemailnotifications = cd['getemailnotifications']
|
||||||
getimportantemails = cd['getimportantemails']
|
getimportantemails = cd['getimportantemails']
|
||||||
|
get_rpe_warnings = cd['get_rpe_warnings']
|
||||||
share_course_results = cd['share_course_results']
|
share_course_results = cd['share_course_results']
|
||||||
defaulttimezone = cd['defaulttimezone']
|
defaulttimezone = cd['defaulttimezone']
|
||||||
fav_analysis = cd['fav_analysis']
|
fav_analysis = cd['fav_analysis']
|
||||||
@@ -522,6 +523,7 @@ def rower_edit_view(request, rowerid=0, userid=0, message=""):
|
|||||||
r.sex = sex
|
r.sex = sex
|
||||||
r.birthdate = birthdate
|
r.birthdate = birthdate
|
||||||
r.autojoin = autojoin
|
r.autojoin = autojoin
|
||||||
|
r.get_rpe_warnings = cd['get_rpe_warnings']
|
||||||
r.emailalternatives = emailalternatives
|
r.emailalternatives = emailalternatives
|
||||||
r.fav_analysis = fav_analysis
|
r.fav_analysis = fav_analysis
|
||||||
r.usersmooth = usersmooth
|
r.usersmooth = usersmooth
|
||||||
|
|||||||
@@ -2206,9 +2206,10 @@ def workouts_view(request, message='', successmessage='',
|
|||||||
'%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
'%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
||||||
|
|
||||||
norpecount = len([w for w in workouts if w.rpe==0])
|
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. \
|
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',
|
return render(request, 'list_workouts.html',
|
||||||
{'workouts': workouts,
|
{'workouts': workouts,
|
||||||
|
|||||||
Reference in New Issue
Block a user