mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-09 22:14:43 +02:00
Update organization address fields
This commit is contained in:
parent
5eaf92caa5
commit
fc353a1ff6
5 changed files with 112 additions and 60 deletions
|
@ -79,17 +79,19 @@ class OrganizationContactForm(RegistrarForm):
|
|||
required=False,
|
||||
choices=DomainApplication.AGENCY_CHOICES,
|
||||
)
|
||||
organization_name = forms.CharField(label="Organization name")
|
||||
address_line1 = forms.CharField(label="Address line 1")
|
||||
organization_name = forms.CharField(label="Organization Name")
|
||||
address_line1 = forms.CharField(label="Street address")
|
||||
address_line2 = forms.CharField(
|
||||
required=False,
|
||||
label="Address line 2",
|
||||
label="Street address line 2",
|
||||
)
|
||||
city = forms.CharField(label="City")
|
||||
state_territory = forms.ChoiceField(
|
||||
label="State/territory",
|
||||
label="State, territory, or military post",
|
||||
choices=[("", "--Select--")] + DomainApplication.StateTerritoryChoices.choices,
|
||||
)
|
||||
zipcode = forms.CharField(label="ZIP code")
|
||||
urbanization = forms.CharField(label="Urbanization (Puerto Rico only)")
|
||||
|
||||
|
||||
class AuthorizingOfficialForm(RegistrarForm):
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 4.1.3 on 2022-12-09 19:27
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("registrar", "0004_domainapplication_federal_agency"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="domainapplication",
|
||||
name="city",
|
||||
field=models.TextField(blank=True, help_text="City", null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="domainapplication",
|
||||
name="urbanization",
|
||||
field=models.TextField(blank=True, help_text="Urbanization", null=True),
|
||||
),
|
||||
]
|
|
@ -28,62 +28,69 @@ class DomainApplication(TimeStampedModel):
|
|||
]
|
||||
|
||||
class StateTerritoryChoices(models.TextChoices):
|
||||
ALABAMA = "AL", "Alabama"
|
||||
ALASKA = "AK", "Alaska"
|
||||
ARIZONA = "AZ", "Arizona"
|
||||
ARKANSAS = "AR", "Arkansas"
|
||||
CALIFORNIA = "CA", "California"
|
||||
COLORADO = "CO", "Colorado"
|
||||
CONNECTICUT = "CT", "Connecticut"
|
||||
DELAWARE = "DE", "Delaware"
|
||||
DISTRICT_OF_COLUMBIA = "DC", "District of Columbia"
|
||||
FLORIDA = "FL", "Florida"
|
||||
GEORGIA = "GA", "Georgia"
|
||||
HAWAII = "HI", "Hawaii"
|
||||
IDAHO = "ID", "Idaho"
|
||||
ILLINOIS = "IL", "Illinois"
|
||||
INDIANA = "IN", "Indiana"
|
||||
IOWA = "IA", "Iowa"
|
||||
KANSAS = "KS", "Kansas"
|
||||
KENTUCKY = "KY", "Kentucky"
|
||||
LOUISIANA = "LA", "Louisiana"
|
||||
MAINE = "ME", "Maine"
|
||||
MARYLAND = "MD", "Maryland"
|
||||
MASSACHUSETTS = "MA", "Massachusetts"
|
||||
MICHIGAN = "MI", "Michigan"
|
||||
MINNESOTA = "MN", "Minnesota"
|
||||
MISSISSIPPI = "MS", "Mississippi"
|
||||
MISSOURI = "MO", "Missouri"
|
||||
MONTANA = "MT", "Montana"
|
||||
NEBRASKA = "NE", "Nebraska"
|
||||
NEVADA = "NV", "Nevada"
|
||||
NEW_HAMPSHIRE = "NH", "New Hampshire"
|
||||
NEW_JERSEY = "NJ", "New Jersey"
|
||||
NEW_MEXICO = "NM", "New Mexico"
|
||||
NEW_YORK = "NY", "New York"
|
||||
NORTH_CAROLINA = "NC", "North Carolina"
|
||||
NORTH_DAKOTA = "ND", "North Dakota"
|
||||
OHIO = "OH", "Ohio"
|
||||
OKLAHOMA = "OK", "Oklahoma"
|
||||
OREGON = "OR", "Oregon"
|
||||
PENNSYLVANIA = "PA", "Pennsylvania"
|
||||
RHODE_ISLAND = "RI", "Rhode Island"
|
||||
SOUTH_CAROLINA = "SC", "South Carolina"
|
||||
SOUTH_DAKOTA = "SD", "South Dakota"
|
||||
TENNESSEE = "TN", "Tennessee"
|
||||
TEXAS = "TX", "Texas"
|
||||
UTAH = "UT", "Utah"
|
||||
VERMONT = "VT", "Vermont"
|
||||
VIRGINIA = "VA", "Virginia"
|
||||
WASHINGTON = "WA", "Washington"
|
||||
WEST_VIRGINIA = "WV", "West Virginia"
|
||||
WISCONSIN = "WI", "Wisconsin"
|
||||
WYOMING = "WY", "Wyoming"
|
||||
AMERICAN_SAMOA = "AS", "American Samoa"
|
||||
GUAM = "GU", "Guam"
|
||||
NORTHERN_MARIANA_ISLANDS = "MP", "Northern Mariana Islands"
|
||||
PUERTO_RICO = "PR", "Puerto Rico"
|
||||
VIRGIN_ISLANDS = "VI", "Virgin Islands"
|
||||
ALABAMA = "AL", "Alabama (AL)"
|
||||
ALASKA = "AK", "Alaska (AK)"
|
||||
AMERICAN_SAMOA = "AS", "American Samoa (AS)"
|
||||
ARIZONA = "AZ", "Arizona (AZ)"
|
||||
ARKANSAS = "AR", "Arkansas (AR)"
|
||||
CALIFORNIA = "CA", "California (CA)"
|
||||
COLORADO = "CO", "Colorado (CO)"
|
||||
CONNECTICUT = "CT", "Connecticut (CT)"
|
||||
DELAWARE = "DE", "Delaware (DE)"
|
||||
DISTRICT_OF_COLUMBIA = "DC", "District of Columbia (DC)"
|
||||
FLORIDA = "FL", "Florida (FL)"
|
||||
GEORGIA = "GA", "Georgia (GA)"
|
||||
GUAM = "GU", "Guam (GU)"
|
||||
HAWAII = "HI", "Hawaii (HI)"
|
||||
IDAHO = "ID", "Idaho (ID)"
|
||||
ILLINOIS = "IL", "Illinois (IL)"
|
||||
INDIANA = "IN", "Indiana (IN)"
|
||||
IOWA = "IA", "Iowa (IA)"
|
||||
KANSAS = "KS", "Kansas (KS)"
|
||||
KENTUCKY = "KY", "Kentucky (KY)"
|
||||
LOUISIANA = "LA", "Louisiana (LA)"
|
||||
MAINE = "ME", "Maine (ME)"
|
||||
MARYLAND = "MD", "Maryland (MD)"
|
||||
MASSACHUSETTS = "MA", "Massachusetts (MA)"
|
||||
MICHIGAN = "MI", "Michigan (MI)"
|
||||
MINNESOTA = "MN", "Minnesota (MN)"
|
||||
MISSISSIPPI = "MS", "Mississippi (MS)"
|
||||
MISSOURI = "MO", "Missouri (MO)"
|
||||
MONTANA = "MT", "Montana (MT)"
|
||||
NEBRASKA = "NE", "Nebraska (NE)"
|
||||
NEVADA = "NV", "Nevada (NV)"
|
||||
NEW_HAMPSHIRE = "NH", "New Hampshire (NH)"
|
||||
NEW_JERSEY = "NJ", "New Jersey (NJ)"
|
||||
NEW_MEXICO = "NM", "New Mexico (NM)"
|
||||
NEW_YORK = "NY", "New York (NY)"
|
||||
NORTH_CAROLINA = "NC", "North Carolina (NC)"
|
||||
NORTH_DAKOTA = "ND", "North Dakota (ND)"
|
||||
NORTHERN_MARIANA_ISLANDS = "MP", "Northern Mariana Islands (MP)"
|
||||
OHIO = "OH", "Ohio (OH)"
|
||||
OKLAHOMA = "OK", "Oklahoma (OK)"
|
||||
OREGON = "OR", "Oregon (OR)"
|
||||
PENNSYLVANIA = "PA", "Pennsylvania (PA)"
|
||||
PUERTO_RICO = "PR", "Puerto Rico (PR)"
|
||||
RHODE_ISLAND = "RI", "Rhode Island (RI)"
|
||||
SOUTH_CAROLINA = "SC", "South Carolina (SC)"
|
||||
SOUTH_DAKOTA = "SD", "South Dakota (SD)"
|
||||
TENNESSEE = "TN", "Tennessee (TN)"
|
||||
TEXAS = "TX", "Texas (TX)"
|
||||
UNITED_STATES_MINOR_OUTLYING_ISLANDS = (
|
||||
"UM",
|
||||
"United States Minor Outlying Islands (UM)",
|
||||
)
|
||||
UTAH = "UT", "Utah (UT)"
|
||||
VERMONT = "VT", "Vermont (VT)"
|
||||
VIRGIN_ISLANDS = "VI", "Virgin Islands (VI)"
|
||||
VIRGINIA = "VA", "Virginia (VA)"
|
||||
WASHINGTON = "WA", "Washington (WA)"
|
||||
WEST_VIRGINIA = "WV", "West Virginia (WV)"
|
||||
WISCONSIN = "WI", "Wisconsin (WI)"
|
||||
WYOMING = "WY", "Wyoming (WY)"
|
||||
ARMED_FORCES_AA = "AA", "Armed Forces Americas (AA)"
|
||||
ARMED_FORCES_AE = "AE", "Armed Forces Africa, Canada, Europe, Middle East (AE)"
|
||||
ARMED_FORCES_AP = "AP", "Armed Forces Pacific (AP)"
|
||||
|
||||
class OrganizationChoices(models.TextChoices):
|
||||
FEDERAL = "federal", "Federal: a federal agency"
|
||||
|
@ -315,6 +322,11 @@ class DomainApplication(TimeStampedModel):
|
|||
blank=True,
|
||||
help_text="Address line 2",
|
||||
)
|
||||
city = models.TextField(
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text="City",
|
||||
)
|
||||
state_territory = models.CharField(
|
||||
max_length=2,
|
||||
null=True,
|
||||
|
@ -328,6 +340,11 @@ class DomainApplication(TimeStampedModel):
|
|||
help_text="ZIP code",
|
||||
db_index=True,
|
||||
)
|
||||
urbanization = models.TextField(
|
||||
null=True,
|
||||
blank=True,
|
||||
help_text="Urbanization",
|
||||
)
|
||||
|
||||
authorizing_official = models.ForeignKey(
|
||||
"registrar.Contact",
|
||||
|
|
|
@ -34,10 +34,14 @@
|
|||
{{ wizard.form.address_line1|add_class:"usa-input" }}
|
||||
{{ wizard.form.address_line2|add_label_class:"usa-label" }}
|
||||
{{ wizard.form.address_line2|add_class:"usa-input" }}
|
||||
{{ wizard.form.city|add_label_class:"usa-label" }}
|
||||
{{ wizard.form.city|add_class:"usa-input" }}
|
||||
{{ wizard.form.state_territory|add_label_class:"usa-label" }}
|
||||
{{ wizard.form.state_territory|add_class:"usa-select" }}
|
||||
{{ wizard.form.zipcode|add_label_class:"usa-label" }}
|
||||
{{ wizard.form.zipcode|add_class:"usa-input usa-input--small" }}
|
||||
{{ wizard.form.urbanization|add_label_class:"usa-label" }}
|
||||
{{ wizard.form.urbanization|add_class:"usa-input usa-input--small" }}
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
|
|
@ -183,8 +183,11 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
org_contact_form = org_contact_page.form
|
||||
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
||||
org_contact_form["organization_contact-address_line1"] = "address 1"
|
||||
org_contact_form["organization_contact-address_line2"] = "address 2"
|
||||
org_contact_form["organization_contact-city"] = "NYC"
|
||||
org_contact_form["organization_contact-state_territory"] = "NY"
|
||||
org_contact_form["organization_contact-zipcode"] = "10002"
|
||||
org_contact_form["organization_contact-urbanization"] = "URB Royal Oaks"
|
||||
|
||||
# test saving the page
|
||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||
|
@ -195,8 +198,11 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
|||
application = DomainApplication.objects.get() # there's only one
|
||||
self.assertEquals(application.organization_name, "Testorg")
|
||||
self.assertEquals(application.address_line1, "address 1")
|
||||
self.assertEquals(application.address_line2, "address 2")
|
||||
self.assertEquals(application.city, "NYC")
|
||||
self.assertEquals(application.state_territory, "NY")
|
||||
self.assertEquals(application.zipcode, "10002")
|
||||
self.assertEquals(application.urbanization, "URB Royal Oaks")
|
||||
|
||||
# test next button
|
||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue