mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-25 10:33:50 +02:00
Set finished_setup as property, remove id
This commit is contained in:
parent
c1d9cb1b13
commit
47de6f17a7
11 changed files with 45 additions and 95 deletions
|
@ -178,12 +178,6 @@ class FinishProfileSetupView(UserProfileView):
|
|||
|
||||
# Get the current form and validate it
|
||||
if form.is_valid():
|
||||
|
||||
completed_states = [self.RedirectType.TO_SPECIFIC_PAGE, self.RedirectType.HOME]
|
||||
if self.redirect_type in completed_states:
|
||||
self.request.user.finished_setup = True
|
||||
self.request.user.save()
|
||||
|
||||
if "contact_setup_save_button" in request.POST:
|
||||
# Logic for when the 'Save' button is clicked
|
||||
self.redirect_type = self.RedirectType.COMPLETE_SETUP
|
||||
|
@ -197,16 +191,6 @@ class FinishProfileSetupView(UserProfileView):
|
|||
else:
|
||||
return self.form_invalid(form)
|
||||
|
||||
def form_valid(self, form):
|
||||
"""Saves the current contact to the database, and if the user is complete
|
||||
with their setup, then we mark user.finished_setup to True."""
|
||||
completed_states = [self.RedirectType.TO_SPECIFIC_PAGE, self.RedirectType.HOME]
|
||||
if self.redirect_type in completed_states:
|
||||
self.request.user.finished_setup = True
|
||||
self.request.user.save()
|
||||
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
"""Redirect to the nameservers page for the domain."""
|
||||
redirect_url = self.get_redirect_url()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue