diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 568a78c05..f887d2978 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -1762,11 +1762,17 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin): if next_char.isdigit(): should_apply_default_filter = True + # Select domain request to change -> Domain requests + if extra_context is None: + extra_context = {} + extra_context["tabtitle"] = "Domain requests" + if should_apply_default_filter: # modify the GET of the request to set the selected filter modified_get = copy.deepcopy(request.GET) modified_get["status__in"] = "submitted,in review,action needed" request.GET = modified_get + response = super().changelist_view(request, extra_context=extra_context) return response @@ -1775,14 +1781,6 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin): self.display_restricted_warning(request, obj) return super().change_view(request, object_id, form_url, extra_context) - # Select domain request to change -> Domain requests - def changelist_view(self, request, extra_context=None): - if extra_context is None: - extra_context = {} - extra_context["tabtitle"] = "Domain requests" - # Get the filtered values - return super().changelist_view(request, extra_context=extra_context) - class TransitionDomainAdmin(ListHeaderAdmin): """Custom transition domain admin class.""" diff --git a/src/registrar/tests/test_views_domain.py b/src/registrar/tests/test_views_domain.py index 5f4088e60..c3bcb02db 100644 --- a/src/registrar/tests/test_views_domain.py +++ b/src/registrar/tests/test_views_domain.py @@ -1087,7 +1087,7 @@ class TestDomainAuthorizingOfficial(TestDomainOverview): """Can load domain's authorizing official page.""" page = self.client.get(reverse("domain-authorizing-official", kwargs={"pk": self.domain.id})) # once on the sidebar, once in the title - self.assertContains(page, "Authorizing official", count=2) + self.assertContains(page, "Authorizing official", count=3) def test_domain_authorizing_official_content(self): """Authorizing official information appears on the page."""