Exclude 2 values from the domain request on the form

This commit is contained in:
Rebecca Hsieh 2024-05-07 16:31:01 -07:00
parent 1b6e6debf6
commit 9311a41ac6
No known key found for this signature in database

View file

@ -97,6 +97,7 @@ class OrganizationElectionForm(RegistrarForm):
class OrganizationContactForm(RegistrarForm): class OrganizationContactForm(RegistrarForm):
# for federal agencies we also want to know the top-level agency. # for federal agencies we also want to know the top-level agency.
excluded_agencies = ["gov Administration", "Non-Federal Agency"]
federal_agency = forms.ModelChoiceField( federal_agency = forms.ModelChoiceField(
label="Federal agency", label="Federal agency",
# not required because this field won't be filled out unless # not required because this field won't be filled out unless
@ -104,9 +105,8 @@ class OrganizationContactForm(RegistrarForm):
# if it has been filled in when required. # if it has been filled in when required.
# uncomment to see if modelChoiceField can be an arg later # uncomment to see if modelChoiceField can be an arg later
required=False, required=False,
queryset=FederalAgency.objects.all(), queryset=FederalAgency.objects.exclude(agency__in=excluded_agencies),
empty_label="--Select--", empty_label="--Select--",
# choices=[("", "--Select--")] + DomainRequest.AGENCY_CHOICES,
) )
organization_name = forms.CharField( organization_name = forms.CharField(
label="Organization name", label="Organization name",