diff --git a/src/registrar/templates/profile.html b/src/registrar/templates/profile.html
index eeab1f945..12441da66 100644
--- a/src/registrar/templates/profile.html
+++ b/src/registrar/templates/profile.html
@@ -36,5 +36,4 @@ Edit your User Profile |
{% include "includes/profile_form.html" with form=form %}
-{% endblock %}
-
+{% endblock content_bottom %}
diff --git a/src/registrar/templatetags/field_helpers.py b/src/registrar/templatetags/field_helpers.py
index a7aa9d663..be78099db 100644
--- a/src/registrar/templatetags/field_helpers.py
+++ b/src/registrar/templatetags/field_helpers.py
@@ -95,10 +95,12 @@ def input_with_errors(context, field=None): # noqa: C901
elif key == "show_edit_button":
# Hide the primary input field.
# Used such that we can toggle it with JS
- if "display-none" not in classes and isinstance(value, bool) and value:
+ if "display-none" not in classes:
classes.append("display-none")
- # Set this as a context value so we know what we're going to display
- context["show_edit_button"] = value
+
+ # Tag that this form contains the edit button.
+ if "usa-form-editable" not in group_classes:
+ group_classes.append("usa-form-editable")
attrs["id"] = field.auto_id
diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py
index 1d14e4b57..a90eaf271 100644
--- a/src/registrar/views/domain_request.py
+++ b/src/registrar/views/domain_request.py
@@ -15,7 +15,6 @@ from registrar.models.user import User
from registrar.utility import StrEnum
from registrar.views.utility import StepsHelper
from registrar.views.utility.permission_views import DomainRequestPermissionDeleteView
-from waffle.decorators import flag_is_active, waffle_flag
from .utility import (
DomainRequestPermissionView,
@@ -23,6 +22,7 @@ from .utility import (
DomainRequestWizardPermissionView,
)
+from waffle.decorators import flag_is_active
logger = logging.getLogger(__name__)
@@ -400,13 +400,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
def get_step_list(self) -> list:
"""Dynamically generated list of steps in the form wizard."""
step_list = []
- excluded_steps = [Step.YOUR_CONTACT]
- should_exclude = flag_is_active(self.request, "profile_feature")
for step in Step:
-
- if should_exclude and step in excluded_steps:
- continue
-
condition = self.WIZARD_CONDITIONS.get(step, True)
if callable(condition):
condition = condition(self)
@@ -546,10 +540,6 @@ class YourContact(DomainRequestWizard):
template_name = "domain_request_your_contact.html"
forms = [forms.YourContactForm]
- @waffle_flag("!profile_feature") # type: ignore
- def dispatch(self, request, *args, **kwargs): # type: ignore
- return super().dispatch(request, *args, **kwargs)
-
class OtherContacts(DomainRequestWizard):
template_name = "domain_request_other_contacts.html"
diff --git a/src/registrar/views/user_profile.py b/src/registrar/views/user_profile.py
index b12812849..a4756f482 100644
--- a/src/registrar/views/user_profile.py
+++ b/src/registrar/views/user_profile.py
@@ -96,10 +96,6 @@ class FinishProfileSetupView(UserProfileView):
"""This view forces the user into providing additional details that
we may have missed from Login.gov"""
- template_name = "finish_profile_setup.html"
- form_class = FinishSetupProfileForm
- model = Contact
-
class RedirectType(Enum):
"""
Enums for each type of redirection. Enforces behaviour on `get_redirect_url()`.
@@ -116,8 +112,17 @@ class FinishProfileSetupView(UserProfileView):
BACK_TO_SELF = "back_to_self"
COMPLETE_SETUP = "complete_setup"
- redirect_type = None
- all_redirect_types = [r.value for r in RedirectType]
+ @classmethod
+ def get_all_redirect_types(cls) -> list[str]:
+ """Returns the value of every redirect type defined in this enum."""
+ return [r.value for r in cls]
+
+ template_name = "finish_profile_setup.html"
+ form_class = FinishSetupProfileForm
+ model = Contact
+
+ all_redirect_types = RedirectType.get_all_redirect_types()
+ redirect_type: RedirectType
def get_context_data(self, **kwargs):
@@ -151,16 +156,18 @@ class FinishProfileSetupView(UserProfileView):
"""
# Update redirect type based on the query parameter if present
- redirect_type = request.GET.get("redirect", self.RedirectType.BACK_TO_SELF.value)
- if redirect_type in self.all_redirect_types:
- self.redirect_type = self.RedirectType(redirect_type)
+ default_redirect_value = self.RedirectType.BACK_TO_SELF.value
+ redirect_value = request.GET.get("redirect", default_redirect_value)
+
+ if redirect_value in self.all_redirect_types:
+ # If the redirect value is a preexisting value in our enum, set it to that.
+ self.redirect_type = self.RedirectType(redirect_value)
else:
- # If the redirect type is undefined, then we assume that
- # we are specifying a particular page to redirect to.
+ # If the redirect type is undefined, then we assume that we are specifying a particular page to redirect to.
self.redirect_type = self.RedirectType.TO_SPECIFIC_PAGE
# Store the page that we want to redirect to for later use
- request.session["redirect_viewname"] = str(redirect_type)
+ request.session["redirect_viewname"] = str(redirect_value)
return super().dispatch(request, *args, **kwargs)
@@ -183,8 +190,7 @@ class FinishProfileSetupView(UserProfileView):
def get_success_url(self):
"""Redirect to the nameservers page for the domain."""
- redirect_url = self.get_redirect_url()
- return redirect_url
+ return self.get_redirect_url()
def get_redirect_url(self):
"""
@@ -220,7 +226,7 @@ class FinishProfileSetupView(UserProfileView):
query_params = {}
# Quote cleans up the value so that it can be used in a url
- if self.redirect_type:
+ if self.redirect_type and self.redirect_type.value:
query_params["redirect"] = quote(self.redirect_type.value)
# Generate the full url from the given query params
diff --git a/src/registrar/views/utility/mixins.py b/src/registrar/views/utility/mixins.py
index 0b8a7605a..926ee4a8c 100644
--- a/src/registrar/views/utility/mixins.py
+++ b/src/registrar/views/utility/mixins.py
@@ -296,7 +296,6 @@ class UserDeleteDomainRolePermission(PermissionsLoginMixin):
domain_pk = self.kwargs["pk"]
user_pk = self.kwargs["user_pk"]
- # Check if the user is authenticated
if not self.request.user.is_authenticated:
return False
diff --git a/src/registrar/views/utility/permission_views.py b/src/registrar/views/utility/permission_views.py
index eb40621b5..d35647af2 100644
--- a/src/registrar/views/utility/permission_views.py
+++ b/src/registrar/views/utility/permission_views.py
@@ -3,7 +3,9 @@
import abc # abstract base class
from django.views.generic import DetailView, DeleteView, TemplateView
-from registrar.models import Domain, DomainRequest, DomainInvitation, UserDomainRole, Contact
+from registrar.models import Domain, DomainRequest, DomainInvitation
+from registrar.models.contact import Contact
+from registrar.models.user_domain_role import UserDomainRole
from .mixins import (
DomainPermission,