Merge branch 'main' into meoward/2247-user-contact

This commit is contained in:
David Kennedy 2024-07-09 16:56:54 -04:00
commit d1a390cec9
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
15 changed files with 392 additions and 127 deletions

View file

@ -1,5 +1,4 @@
"""Views for a User Profile.
"""
import logging
@ -106,6 +105,7 @@ class UserProfileView(UserProfilePermissionView, FormMixin):
"""If the form is invalid, conditionally display an additional error."""
if hasattr(self.user, "finished_setup") and not self.user.finished_setup:
messages.error(self.request, "Before you can manage your domain, we need you to add contact information.")
form.initial["redirect"] = form.data.get("redirect")
return super().form_invalid(form)
def form_valid(self, form):