Merge pull request #2182 from cisagov/za/2142-federal-agency-readonly

Ticket #2142: Set "federal_agency" as readonly for domain, domain request, and domain information
This commit is contained in:
zandercymatics 2024-05-23 12:21:34 -06:00 committed by GitHub
commit ef4e758517
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -1173,7 +1173,7 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
] ]
# Readonly fields for analysts and superusers # Readonly fields for analysts and superusers
readonly_fields = ("other_contacts", "generic_org_type", "is_election_board") readonly_fields = ("other_contacts", "generic_org_type", "is_election_board", "federal_agency")
# Read only that we'll leverage for CISA Analysts # Read only that we'll leverage for CISA Analysts
analyst_readonly_fields = [ analyst_readonly_fields = [
@ -1440,6 +1440,7 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
"alternative_domains", "alternative_domains",
"generic_org_type", "generic_org_type",
"is_election_board", "is_election_board",
"federal_agency",
) )
# Read only that we'll leverage for CISA Analysts # Read only that we'll leverage for CISA Analysts
@ -1881,7 +1882,7 @@ class DomainAdmin(ListHeaderAdmin, ImportExportModelAdmin):
search_fields = ["name"] search_fields = ["name"]
search_help_text = "Search by domain name." search_help_text = "Search by domain name."
change_form_template = "django/admin/domain_change_form.html" change_form_template = "django/admin/domain_change_form.html"
readonly_fields = ["state", "expiration_date", "first_ready", "deleted"] readonly_fields = ("state", "expiration_date", "first_ready", "deleted", "federal_agency")
# Table ordering # Table ordering
ordering = ["name"] ordering = ["name"]

View file

@ -2232,6 +2232,7 @@ class TestDomainRequestAdmin(MockEppLib):
"alternative_domains", "alternative_domains",
"generic_org_type", "generic_org_type",
"is_election_board", "is_election_board",
"federal_agency",
"id", "id",
"created_at", "created_at",
"updated_at", "updated_at",
@ -2286,6 +2287,7 @@ class TestDomainRequestAdmin(MockEppLib):
"alternative_domains", "alternative_domains",
"generic_org_type", "generic_org_type",
"is_election_board", "is_election_board",
"federal_agency",
"creator", "creator",
"about_your_organization", "about_your_organization",
"requested_domain", "requested_domain",
@ -2314,6 +2316,7 @@ class TestDomainRequestAdmin(MockEppLib):
"alternative_domains", "alternative_domains",
"generic_org_type", "generic_org_type",
"is_election_board", "is_election_board",
"federal_agency",
] ]
self.assertEqual(readonly_fields, expected_fields) self.assertEqual(readonly_fields, expected_fields)
@ -3172,6 +3175,7 @@ class TestDomainInformationAdmin(TestCase):
"other_contacts", "other_contacts",
"generic_org_type", "generic_org_type",
"is_election_board", "is_election_board",
"federal_agency",
"creator", "creator",
"type_of_work", "type_of_work",
"more_organization_information", "more_organization_information",