mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
cleanup
This commit is contained in:
parent
7a666c536f
commit
dbd418dc48
4 changed files with 21 additions and 7 deletions
|
@ -47,7 +47,7 @@ class UserProfileForm(forms.ModelForm):
|
|||
self.fields["middle_name"].label = "Middle name (optional)"
|
||||
self.fields["last_name"].label = "Last name / family name"
|
||||
self.fields["title"].label = "Title or role in your organization"
|
||||
self.fields["email"].label = "Organizational email"
|
||||
self.fields["email"].label = "Organization email"
|
||||
|
||||
# Set custom error messages
|
||||
self.fields["first_name"].error_messages = {"required": "Enter your first name / given name."}
|
||||
|
|
|
@ -68,11 +68,10 @@ class CheckUserProfileMiddleware:
|
|||
return None
|
||||
|
||||
if request.user.is_authenticated:
|
||||
if request.user.verification_type == User.VerificationTypeChoices.REGULAR:
|
||||
if hasattr(request.user, "finished_setup") and not request.user.finished_setup:
|
||||
if request.user.verification_type == User.VerificationTypeChoices.REGULAR:
|
||||
return self._handle_regular_user_setup_not_finished(request)
|
||||
else:
|
||||
if hasattr(request.user, "finished_setup") and not request.user.finished_setup:
|
||||
return self._handle_other_user_setup_not_finished(request)
|
||||
|
||||
# Continue processing the view
|
||||
|
|
|
@ -49,7 +49,7 @@ Edit your User Profile |
|
|||
data-open-modal
|
||||
>Open confirmation modal</a>
|
||||
<div
|
||||
class="usa-modal is-visible"
|
||||
class="usa-modal usa-modal--lg is-visible"
|
||||
id="toggle-confirmation-modal"
|
||||
aria-labelledby="Add contact information"
|
||||
aria-describedby="Add contact information"
|
||||
|
@ -79,6 +79,16 @@ Edit your User Profile |
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
class="usa-button usa-modal__close"
|
||||
aria-label="Close this window"
|
||||
data-close-modal
|
||||
>
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#close"></use>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -15,6 +15,7 @@ from django.urls import NoReverseMatch, reverse
|
|||
from registrar.models import (
|
||||
Contact,
|
||||
)
|
||||
from registrar.models.user import User
|
||||
from registrar.models.utility.generic_helper import replace_url_queryparams
|
||||
from registrar.views.utility.permission_views import UserProfilePermissionView
|
||||
from waffle.decorators import flag_is_active, waffle_flag
|
||||
|
@ -41,7 +42,11 @@ class UserProfileView(UserProfilePermissionView, FormMixin):
|
|||
form = self.form_class(instance=self.object)
|
||||
context = self.get_context_data(object=self.object, form=form)
|
||||
|
||||
if hasattr(self.user, "finished_setup") and not self.user.finished_setup:
|
||||
if (
|
||||
hasattr(self.user, "finished_setup")
|
||||
and not self.user.finished_setup
|
||||
and self.user.verification_type != User.VerificationTypeChoices.REGULAR
|
||||
):
|
||||
context["show_confirmation_modal"] = True
|
||||
|
||||
return_to_request = request.GET.get("return_to_request")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue