14 days no survey for new users
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user