Commit 57268420 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

added welcome trackers to form validation

parent 47944fc5
......@@ -118,6 +118,14 @@ class WelcomeName(LoginRequiredMixin, FormView):
form_class = WelcomeNameForm
login_url = 'login'
def form_valid(self, form):
self.obj = self.get_object()
self.obj.completedName = True
self.obj.save()
return super(WelcomeName, self).form_valid(form)
def get_success_url(self):
return reverse('welcomePrivacy',
kwargs={'slug':self.request.user.username})
......@@ -131,6 +139,14 @@ class WelcomePrivacy(LoginRequiredMixin, UpdateView):
login_url = 'login'
def form_valid(self, form):
self.obj = self.get_object()
self.obj.completedPrivacy = True
self.obj.save()
return super(WelcomePrivacy, self).form_valid(form)
def get_success_url(self):
return reverse('welcomeMajor',
kwargs={'slug':self.request.user.username})
......@@ -144,6 +160,15 @@ class WelcomeMajor(LoginRequiredMixin, UpdateView):
login_url = 'login'
def form_valid(self, form):
self.obj = self.get_object()
self.obj.completedMajor = True
self.obj.save()
return super(WelcomeMajor, self).form_valid(form)
def get_success_url(self):
return reverse('welcomeSocial',
kwargs={'slug':self.request.user.username})
......@@ -158,6 +183,14 @@ class WelcomeSocial(LoginRequiredMixin, DetailView):
# push to the message queue
def form_valid(self, form):
self.obj = self.get_object()
self.obj.completedSocial = True
self.obj.save()
return super(WelcomeSocial, self).form_valid(form)
def get_success_url(self):
return reverse('detail_student',
kwargs={'slug':self.request.user.username})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment