From 162d42e6478c9e5ddcb48312ab8b3617fc7f38d5 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 14:43:17 -0400 Subject: [PATCH 01/12] Setup org name address page --- src/registrar/config/urls.py | 5 ++ src/registrar/forms/__init__.py | 1 + src/registrar/forms/domain.py | 57 ++++++++++++++++++- .../templates/domain_org_name_address.html | 47 +++++++++++++++ src/registrar/views/__init__.py | 1 + src/registrar/views/domain.py | 47 ++++++++++++++- 6 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 src/registrar/templates/domain_org_name_address.html diff --git a/src/registrar/config/urls.py b/src/registrar/config/urls.py index a19da4791..0ef9fbe36 100644 --- a/src/registrar/config/urls.py +++ b/src/registrar/config/urls.py @@ -88,6 +88,11 @@ urlpatterns = [ views.DomainYourContactInformationView.as_view(), name="domain-your-contact-information", ), + path( + "domain//org-name-address", + views.DomainOrgNameAddressView.as_view(), + name="domain-org-name-address", + ), path( "domain//authorizing-official", views.DomainAuthorizingOfficialView.as_view(), diff --git a/src/registrar/forms/__init__.py b/src/registrar/forms/__init__.py index 364740211..13f75563f 100644 --- a/src/registrar/forms/__init__.py +++ b/src/registrar/forms/__init__.py @@ -3,5 +3,6 @@ from .domain import ( DomainAddUserForm, NameserverFormset, DomainSecurityEmailForm, + DomainOrgNameAddressForm, ContactForm, ) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index e6fbc8fee..a86993cfb 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -5,7 +5,7 @@ from django.forms import formset_factory from phonenumber_field.widgets import RegionalPhoneNumberWidget -from ..models import Contact +from ..models import Contact, DomainInformation class DomainAddUserForm(forms.Form): @@ -64,3 +64,58 @@ class DomainSecurityEmailForm(forms.Form): """Form for adding or editing a security email to a domain.""" security_email = forms.EmailField(label="Security email") + + +class DomainOrgNameAddressForm(forms.ModelForm): + + """Form for updating the organization name and mailing address.""" + + class Meta: + model = DomainInformation + fields = ["federal_agency", "organization_name", "address_line1", "address_line2", "city", "state_territory", "zipcode", "urbanization"] + labels = { + "address_line1": "Street address", + "address_line2": "Street address line 2", + "state_territory": "State, territory, or military post", + "urbanization": "Urbanization (Puerto Rico only)", + } + error_messages = { + "federal_agency": {"required": "Select the federal agency for your organization." }, + "organization_name": {"required": "Enter the name of your organization." }, + "address_line1": {"required": "Enter the street address of your organization." }, + "city": {"required": "Enter the city where your organization is located."}, + "state_territory": {"required": "Select the state, territory, or military post where your organization is located."}, + "zipcode": {"required": "Enter a zip code in the form of 12345 or 12345-6789."}, + } + widgets = { + "federal_agency": forms.Select(attrs={"required": True}, choices=DomainInformation.AGENCY_CHOICES), + "organization_name": forms.TextInput, + "address_line1": forms.TextInput, + "address_line2": forms.TextInput, + "city": forms.TextInput, + "state_territory": forms.Select(attrs={"required": True,}, choices=DomainInformation.StateTerritoryChoices.choices), + "zipcode": forms.TextInput, + "urbanization" : forms.TextInput, + } + + # the database fields have blank=True so ModelForm doesn't create + # required fields by default. Use this list in __init__ to mark each + # of these fields as required + required = ["organization_name", "address_line1", "city", "zipcode"] + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + for field_name in self.required: + self.fields[field_name].required = True + self.fields["state_territory"].widget.attrs.pop("maxlength", None) + self.fields["zipcode"].widget.attrs.pop("maxlength", None) + + + + + + + + + + diff --git a/src/registrar/templates/domain_org_name_address.html b/src/registrar/templates/domain_org_name_address.html new file mode 100644 index 000000000..587ba4782 --- /dev/null +++ b/src/registrar/templates/domain_org_name_address.html @@ -0,0 +1,47 @@ +{% extends "domain_base.html" %} +{% load static field_helpers%} + +{% block title %}Organization name and mailing address | {{ domain.name }} | {% endblock %} + +{% block domain_content %} + {# this is right after the messages block in the parent template #} + {% include "includes/form_errors.html" with form=form %} + +

Organization name and mailing address

+ +

The name of your organization will be publicly listed as the domain registrant.

+ + {% include "includes/required_fields.html" %} + +
+ {% csrf_token %} + + {% if domain.domain_info.organization_type == 'federal' %} + {% input_with_errors form.federal_agency %} + {% endif %} + + {% input_with_errors form.organization_name %} + + {% input_with_errors form.address_line1 %} + + {% input_with_errors form.address_line2 %} + + {% input_with_errors form.city %} + + {% input_with_errors form.state_territory %} + + {% with add_class="usa-input--small" %} + {% input_with_errors form.zipcode %} + {% endwith %} + + {% input_with_errors form.urbanization %} + + +
+ +{% endblock %} {# domain_content #} diff --git a/src/registrar/views/__init__.py b/src/registrar/views/__init__.py index 8212d140d..ed1d8ba39 100644 --- a/src/registrar/views/__init__.py +++ b/src/registrar/views/__init__.py @@ -2,6 +2,7 @@ from .application import * from .domain import ( DomainView, DomainAuthorizingOfficialView, + DomainOrgNameAddressView, DomainNameserversView, DomainYourContactInformationView, DomainSecurityEmailView, diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 9771a09c6..9c410a788 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -22,10 +22,11 @@ from registrar.models import ( ) from ..forms import ( - DomainAddUserForm, - NameserverFormset, - DomainSecurityEmailForm, ContactForm, + DomainOrgNameAddressForm, + DomainAddUserForm, + DomainSecurityEmailForm, + NameserverFormset, ) from ..utility.email import send_templated_email, EmailSendingError from .utility import DomainPermissionView, DomainInvitationPermissionDeleteView @@ -40,6 +41,46 @@ class DomainView(DomainPermissionView): template_name = "domain_detail.html" +class DomainOrgNameAddressView(DomainPermissionView, FormMixin): + """Organization name and mailing address view """ + model = Domain + template_name = "domain_org_name_address.html" + context_object_name = "domain" + form_class = DomainOrgNameAddressForm + + def get_form_kwargs(self, *args, **kwargs): + """Add domain_info.organization_name instance to make a bound form.""" + form_kwargs = super().get_form_kwargs(*args, **kwargs) + form_kwargs["instance"] = self.get_object().domain_info + return form_kwargs + + def get_success_url(self): + """Redirect to the overview page for the domain.""" + return reverse("domain-org-name-address", kwargs={"pk": self.object.pk}) + + def post(self, request, *args, **kwargs): + """Form submission posts to this view. + + This post method harmonizes using DetailView and FormMixin together. + """ + self.object = self.get_object() + form = self.get_form() + if form.is_valid(): + return self.form_valid(form) + else: + return self.form_invalid(form) + + def form_valid(self, form): + """The form is valid, save the organization name and mailing address.""" + form.save() + + messages.success( + self.request, "The organization name and mailing address has been updated." + ) + # superclass has the redirect + return super().form_valid(form) + + class DomainAuthorizingOfficialView(DomainPermissionView, FormMixin): From 8816b06c66cc0331211e6e8a8d0aeecc61eeb08d Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 14:43:58 -0400 Subject: [PATCH 02/12] Add org name address page to sidebar --- src/registrar/templates/domain_sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html index 5b0457e55..1e4cd1882 100644 --- a/src/registrar/templates/domain_sidebar.html +++ b/src/registrar/templates/domain_sidebar.html @@ -22,7 +22,7 @@
  • - {% url 'todo' as url %} + {% url 'domain-org-name-address' pk=domain.id as url %} From e93f680746ba7cfb9dbe0550a7f2edd568680054 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 14:49:16 -0400 Subject: [PATCH 03/12] Adjust py code formatting --- src/registrar/forms/domain.py | 62 +++++++++++++++++++++-------------- src/registrar/views/domain.py | 7 ++-- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index a86993cfb..e90da3b35 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -72,30 +72,54 @@ class DomainOrgNameAddressForm(forms.ModelForm): class Meta: model = DomainInformation - fields = ["federal_agency", "organization_name", "address_line1", "address_line2", "city", "state_territory", "zipcode", "urbanization"] + fields = [ + "federal_agency", + "organization_name", + "address_line1", + "address_line2", + "city", + "state_territory", + "zipcode", + "urbanization", + ] labels = { - "address_line1": "Street address", - "address_line2": "Street address line 2", - "state_territory": "State, territory, or military post", - "urbanization": "Urbanization (Puerto Rico only)", - } + "address_line1": "Street address", + "address_line2": "Street address line 2", + "state_territory": "State, territory, or military post", + "urbanization": "Urbanization (Puerto Rico only)", + } error_messages = { - "federal_agency": {"required": "Select the federal agency for your organization." }, - "organization_name": {"required": "Enter the name of your organization." }, - "address_line1": {"required": "Enter the street address of your organization." }, + "federal_agency": { + "required": "Select the federal agency for your organization." + }, + "organization_name": {"required": "Enter the name of your organization."}, + "address_line1": { + "required": "Enter the street address of your organization." + }, "city": {"required": "Enter the city where your organization is located."}, - "state_territory": {"required": "Select the state, territory, or military post where your organization is located."}, - "zipcode": {"required": "Enter a zip code in the form of 12345 or 12345-6789."}, + "state_territory": { + "required": "Select the state, territory, or military post where your organization is located." + }, + "zipcode": { + "required": "Enter a zip code in the form of 12345 or 12345-6789." + }, } widgets = { - "federal_agency": forms.Select(attrs={"required": True}, choices=DomainInformation.AGENCY_CHOICES), + "federal_agency": forms.Select( + attrs={"required": True}, choices=DomainInformation.AGENCY_CHOICES + ), "organization_name": forms.TextInput, "address_line1": forms.TextInput, "address_line2": forms.TextInput, "city": forms.TextInput, - "state_territory": forms.Select(attrs={"required": True,}, choices=DomainInformation.StateTerritoryChoices.choices), + "state_territory": forms.Select( + attrs={ + "required": True, + }, + choices=DomainInformation.StateTerritoryChoices.choices, + ), "zipcode": forms.TextInput, - "urbanization" : forms.TextInput, + "urbanization": forms.TextInput, } # the database fields have blank=True so ModelForm doesn't create @@ -109,13 +133,3 @@ class DomainOrgNameAddressForm(forms.ModelForm): self.fields[field_name].required = True self.fields["state_territory"].widget.attrs.pop("maxlength", None) self.fields["zipcode"].widget.attrs.pop("maxlength", None) - - - - - - - - - - diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 9c410a788..6a33ec994 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -41,8 +41,10 @@ class DomainView(DomainPermissionView): template_name = "domain_detail.html" + class DomainOrgNameAddressView(DomainPermissionView, FormMixin): - """Organization name and mailing address view """ + """Organization name and mailing address view""" + model = Domain template_name = "domain_org_name_address.html" context_object_name = "domain" @@ -52,7 +54,7 @@ class DomainOrgNameAddressView(DomainPermissionView, FormMixin): """Add domain_info.organization_name instance to make a bound form.""" form_kwargs = super().get_form_kwargs(*args, **kwargs) form_kwargs["instance"] = self.get_object().domain_info - return form_kwargs + return form_kwargs def get_success_url(self): """Redirect to the overview page for the domain.""" @@ -81,7 +83,6 @@ class DomainOrgNameAddressView(DomainPermissionView, FormMixin): return super().form_valid(form) - class DomainAuthorizingOfficialView(DomainPermissionView, FormMixin): """Domain authorizing official editing view.""" From b03f280b0eabf0c6d231d7af92ce3efc7977ab3b Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 14:52:00 -0400 Subject: [PATCH 04/12] Make line shorter per linter --- src/registrar/forms/domain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index e90da3b35..3a77fa2e4 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -98,7 +98,8 @@ class DomainOrgNameAddressForm(forms.ModelForm): }, "city": {"required": "Enter the city where your organization is located."}, "state_territory": { - "required": "Select the state, territory, or military post where your organization is located." + "required": "Select the state, territory, or military post where your" + "organization is located." }, "zipcode": { "required": "Enter a zip code in the form of 12345 or 12345-6789." From 6489218d82ed4d514f8866ff348ca74997d36570 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 17:43:22 -0400 Subject: [PATCH 05/12] Add validation for zipcode --- src/registrar/forms/domain.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 3a77fa2e4..62c50add5 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -1,6 +1,7 @@ """Forms for domain management.""" from django import forms +from django.core.validators import RegexValidator from django.forms import formset_factory from phonenumber_field.widgets import RegionalPhoneNumberWidget @@ -70,6 +71,16 @@ class DomainOrgNameAddressForm(forms.ModelForm): """Form for updating the organization name and mailing address.""" + zipcode = forms.CharField( + label="Zip code", + validators=[ + RegexValidator( + "^[0-9]{5}(?:-[0-9]{4})?$|^$", + message="Enter a zip code in the form of 12345 or 12345-6789.", + ) + ], + ) + class Meta: model = DomainInformation fields = [ @@ -101,9 +112,6 @@ class DomainOrgNameAddressForm(forms.ModelForm): "required": "Select the state, territory, or military post where your" "organization is located." }, - "zipcode": { - "required": "Enter a zip code in the form of 12345 or 12345-6789." - }, } widgets = { "federal_agency": forms.Select( @@ -119,7 +127,6 @@ class DomainOrgNameAddressForm(forms.ModelForm): }, choices=DomainInformation.StateTerritoryChoices.choices, ), - "zipcode": forms.TextInput, "urbanization": forms.TextInput, } @@ -134,3 +141,10 @@ class DomainOrgNameAddressForm(forms.ModelForm): self.fields[field_name].required = True self.fields["state_territory"].widget.attrs.pop("maxlength", None) self.fields["zipcode"].widget.attrs.pop("maxlength", None) +""" + def clean(self): + data = super().clean() + if not re.match(r"^[0-9]{5}(?:-[0-9]{4})?$|^$", data["zipcode"]): + raise forms.ValidationError("Enter a zip code in the form of 12345 or 12345-6789.", code="invalid") + return self.cleaned_data + """ From ea1b89fdb26a09d12c59a092742c215b4de81ed9 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 7 Jun 2023 17:43:46 -0400 Subject: [PATCH 06/12] Remove commented out code --- src/registrar/forms/domain.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 62c50add5..6a1077672 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -141,10 +141,3 @@ class DomainOrgNameAddressForm(forms.ModelForm): self.fields[field_name].required = True self.fields["state_territory"].widget.attrs.pop("maxlength", None) self.fields["zipcode"].widget.attrs.pop("maxlength", None) -""" - def clean(self): - data = super().clean() - if not re.match(r"^[0-9]{5}(?:-[0-9]{4})?$|^$", data["zipcode"]): - raise forms.ValidationError("Enter a zip code in the form of 12345 or 12345-6789.", code="invalid") - return self.cleaned_data - """ From 4cab4be98bbad151311551c4d62a3f9af7a7307a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Thu, 8 Jun 2023 10:00:23 -0400 Subject: [PATCH 07/12] Add tests for org name and address --- src/registrar/tests/test_views.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index bf1cef2f2..4b5371c90 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -1058,6 +1058,7 @@ class TestDomainPermissions(TestWithDomainPermissions): "domain-users", "domain-users-add", "domain-nameservers", + "domain-org-name-address", "domain-authorizing-official", "domain-your-contact-information", "domain-security-email", @@ -1078,6 +1079,7 @@ class TestDomainPermissions(TestWithDomainPermissions): "domain-users", "domain-users-add", "domain-nameservers", + "domain-org-name-address", "domain-authorizing-official", "domain-your-contact-information", "domain-security-email", @@ -1315,6 +1317,23 @@ class TestDomainDetail(TestWithDomainPermissions, WebTest): ) self.assertContains(page, "Testy") + def test_domain_org_name_address(self): + """Can load domain's org name and mailing address page.""" + page = self.client.get( + reverse("domain-org-name-address", kwargs={"pk": self.domain.id}) + ) + # once on the sidebar, once in the page title, once as H1 + self.assertContains(page, "Organization name and mailing address", count=3) + + def test_domain_org_name_address_content(self): + """Org name and address information appears on the page.""" + self.domain_information.organization_name = "Town of Igorville" + self.domain_information.save() + page = self.app.get( + reverse("domain-org-name-address", kwargs={"pk": self.domain.id}) + ) + self.assertContains(page, "Town of Igorville") + def test_domain_your_contact_information(self): """Can load domain's your contact information page.""" page = self.client.get( From 8d8c2a258c864a99147b206df56c52207b9b349c Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 9 Jun 2023 11:46:33 -0400 Subject: [PATCH 08/12] PR edit: remove lables, replace with verbose_name, comment required attributes --- src/registrar/forms/domain.py | 10 ++++------ src/registrar/models/domain_information.py | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 6a1077672..986085d69 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -93,12 +93,6 @@ class DomainOrgNameAddressForm(forms.ModelForm): "zipcode", "urbanization", ] - labels = { - "address_line1": "Street address", - "address_line2": "Street address line 2", - "state_territory": "State, territory, or military post", - "urbanization": "Urbanization (Puerto Rico only)", - } error_messages = { "federal_agency": { "required": "Select the federal agency for your organization." @@ -114,6 +108,10 @@ class DomainOrgNameAddressForm(forms.ModelForm): }, } widgets = { + # We need to set the required attributed for federal_agency and + # state/territory because for these fields we are creating an individual + # instance of the Select. For the other fields we use the for loop to set + # the class's required attribute to true. "federal_agency": forms.Select( attrs={"required": True}, choices=DomainInformation.AGENCY_CHOICES ), diff --git a/src/registrar/models/domain_information.py b/src/registrar/models/domain_information.py index 78b68a3fa..b12039e73 100644 --- a/src/registrar/models/domain_information.py +++ b/src/registrar/models/domain_information.py @@ -100,11 +100,13 @@ class DomainInformation(TimeStampedModel): null=True, blank=True, help_text="Street address", + verbose_name="Street address", ) address_line2 = models.TextField( null=True, blank=True, help_text="Street address line 2", + verbose_name="Street address line 2", ) city = models.TextField( null=True, @@ -116,6 +118,7 @@ class DomainInformation(TimeStampedModel): null=True, blank=True, help_text="State, territory, or military post", + verbose_name="State, territory, or military post", ) zipcode = models.CharField( max_length=10, @@ -128,6 +131,7 @@ class DomainInformation(TimeStampedModel): null=True, blank=True, help_text="Urbanization (Puerto Rico only)", + verbose_name="Urbanization (Puerto Rico only)", ) type_of_work = models.TextField( From 045ddbdd92d9d4467071f45e5ce1d4753936b83c Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 9 Jun 2023 11:46:53 -0400 Subject: [PATCH 09/12] PR edit: additional test of the form --- src/registrar/tests/test_views.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 4b5371c90..17274aef2 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -1334,6 +1334,25 @@ class TestDomainDetail(TestWithDomainPermissions, WebTest): ) self.assertContains(page, "Town of Igorville") + def test_domain_org_name_address_form(self): + """Submitting changes works on the org name address page.""" + self.domain_information.organization_name = "Town of Igorville" + self.domain_information.save() + org_name_page = self.app.get( + reverse("domain-org-name-address", kwargs={"pk": self.domain.id}) + ) + session_id = self.app.cookies[settings.SESSION_COOKIE_NAME] + + org_name_page.form["organization_name"] = "Not igorville" + org_name_page.form["city"] = "Faketown" + + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + success_result_page = org_name_page.form.submit() + self.assertEqual(success_result_page.status_code, 200) + + self.assertContains(success_result_page, "Not igorville") + self.assertContains(success_result_page, "Faketown") + def test_domain_your_contact_information(self): """Can load domain's your contact information page.""" page = self.client.get( From 2f20dbb70f0c5c82c17a47b9a4ccbc85a4c6ddfc Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 9 Jun 2023 11:47:59 -0400 Subject: [PATCH 10/12] Replace TODO link on domain overview for org name address --- src/registrar/templates/domain_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html index ef3484dfc..dd176c862 100644 --- a/src/registrar/templates/domain_detail.html +++ b/src/registrar/templates/domain_detail.html @@ -14,7 +14,7 @@ Add DNS name servers {% endif %} - {% url 'todo' as url %} + {% url 'domain-org-name-address' pk=domain.id as url %} {% include "includes/summary_item.html" with title='Organization name and mailing address' value=domain.domain_info address='true' edit_link=url %} {% url 'domain-authorizing-official' pk=domain.id as url %} From ace6b338ee3c5610eb7aeb22d541e16d6bce933a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 9 Jun 2023 12:05:03 -0400 Subject: [PATCH 11/12] Linting: remove trailing space --- src/registrar/forms/domain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 986085d69..f14448bcf 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -110,8 +110,8 @@ class DomainOrgNameAddressForm(forms.ModelForm): widgets = { # We need to set the required attributed for federal_agency and # state/territory because for these fields we are creating an individual - # instance of the Select. For the other fields we use the for loop to set - # the class's required attribute to true. + # instance of the Select. For the other fields we use the for loop to set + # the class's required attribute to true. "federal_agency": forms.Select( attrs={"required": True}, choices=DomainInformation.AGENCY_CHOICES ), From 020e6763e4dadd62adda1e3e8c4fa6bbe318067a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Fri, 9 Jun 2023 12:39:15 -0400 Subject: [PATCH 12/12] Generate migrations file --- ...omaininformation_address_line1_and_more.py | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/registrar/migrations/0027_alter_domaininformation_address_line1_and_more.py diff --git a/src/registrar/migrations/0027_alter_domaininformation_address_line1_and_more.py b/src/registrar/migrations/0027_alter_domaininformation_address_line1_and_more.py new file mode 100644 index 000000000..9f362c956 --- /dev/null +++ b/src/registrar/migrations/0027_alter_domaininformation_address_line1_and_more.py @@ -0,0 +1,53 @@ +# Generated by Django 4.2.1 on 2023-06-09 16:38 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("registrar", "0026_alter_domainapplication_address_line2_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="domaininformation", + name="address_line1", + field=models.TextField( + blank=True, + help_text="Street address", + null=True, + verbose_name="Street address", + ), + ), + migrations.AlterField( + model_name="domaininformation", + name="address_line2", + field=models.TextField( + blank=True, + help_text="Street address line 2", + null=True, + verbose_name="Street address line 2", + ), + ), + migrations.AlterField( + model_name="domaininformation", + name="state_territory", + field=models.CharField( + blank=True, + help_text="State, territory, or military post", + max_length=2, + null=True, + verbose_name="State, territory, or military post", + ), + ), + migrations.AlterField( + model_name="domaininformation", + name="urbanization", + field=models.TextField( + blank=True, + help_text="Urbanization (Puerto Rico only)", + null=True, + verbose_name="Urbanization (Puerto Rico only)", + ), + ), + ]