Set finished_setup as property, remove id

This commit is contained in:
zandercymatics 2024-05-21 14:37:53 -06:00
parent c1d9cb1b13
commit 47de6f17a7
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
11 changed files with 45 additions and 95 deletions

View file

@ -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()