Private
Public Access
1
0

lots a small stuff

This commit is contained in:
Sander Roosendaal
2021-04-26 19:35:11 +02:00
parent 594ee6239a
commit 62d06a2439
33 changed files with 144 additions and 149 deletions

View File

@@ -44,10 +44,10 @@ class SurveyMiddleWare(object):
if request.user.is_authenticated and request.path not in allowed_paths:
r = getrower(request.user)
nexturl = request.path
if 'survey' in nexturl:
if 'survey' in nexturl: # pragma: no cover
nexturl = '/rowers/list-workouts'
mustseesurvey = request.user.date_joined <= timezone.now()-datetime.timedelta(days=14) and not r.surveydone
if mustseesurvey:
if mustseesurvey: # pragma: no cover
return redirect(
'/rowers/survey/?next=%s' % nexturl
)
@@ -64,7 +64,7 @@ class GDPRMiddleWare(object):
if request.user.is_authenticated and request.path not in allowed_paths:
r = getrower(request.user)
nexturl = request.path
if 'optin' in nexturl:
if 'optin' in nexturl: # pragma: no cover
nexturl = '/rowers/list-workouts'
if not r.gdproptin:
return redirect(
@@ -82,7 +82,7 @@ class RowerPlanMiddleWare(object):
def __call__(self, request):
if request.user.is_authenticated and request.user.rower.rowerplan not in ['basic','freecoach']:
if request.user.rower.paymenttype == 'single':
if request.user.rower.planexpires < timezone.now().date():
if request.user.rower.planexpires < timezone.now().date(): # pragma: no cover
messg = 'Your paid plan has expired. We have reset you to a free basic plan.'
messages.error(request,messg)
r = getrower(request.user)