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