Private
Public Access
1
0

14 days no survey for new users

This commit is contained in:
Sander Roosendaal
2020-01-09 10:53:06 +01:00
parent 09a490c064
commit 6c827bef96
3 changed files with 60 additions and 3 deletions

View File

@@ -1,4 +1,3 @@
from django.utils import timezone
from rowers.models import Workout, PowerTimeFitnessMetric, Rower, PaidPlan
import datetime
@@ -111,7 +110,8 @@ class SurveyMiddleWare(object):
nexturl = request.path
if 'survey' in nexturl:
nexturl = '/rowers/list-workouts'
if not r.surveydone:
mustseesurvey = request.user.date_joined <= timezone.now()-datetime.timedelta(days=14) and not r.surveydone
if mustseesurvey:
return redirect(
'/rowers/survey/?next=%s' % nexturl
)