From 2ee3df91b9774d6f8152abed2151962ba5722129 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 6 Mar 2024 15:13:11 -0700 Subject: [PATCH 1/5] added blanks to public_contact fields (to remove required-field error in frontend form) --- src/registrar/models/public_contact.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index 989dfb0cd..262455c1e 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -8,8 +8,6 @@ from registrar.utility.enums import DefaultEmail from .utility.time_stamped_model import TimeStampedModel -from phonenumber_field.modelfields import PhoneNumberField # type: ignore - def get_id(): """Generate a 16 character registry ID with a low probability of collision.""" @@ -62,17 +60,17 @@ class PublicContact(TimeStampedModel): ) name = models.CharField(null=False, help_text="Contact's full name") - org = models.CharField(null=True, help_text="Contact's organization (null ok)") + org = models.CharField(null=True, blank=True, help_text="Contact's organization (null ok)") street1 = models.CharField(null=False, help_text="Contact's street") - street2 = models.CharField(null=True, help_text="Contact's street (null ok)") - street3 = models.CharField(null=True, help_text="Contact's street (null ok)") + street2 = models.CharField(null=True, blank=True, help_text="Contact's street (null ok)") + street3 = models.CharField(null=True, blank=True, help_text="Contact's street (null ok)") city = models.CharField(null=False, help_text="Contact's city") sp = models.CharField(null=False, help_text="Contact's state or province") pc = models.CharField(null=False, help_text="Contact's postal code") cc = models.CharField(null=False, help_text="Contact's country code") - email = models.EmailField(null=False, help_text="Contact's email address") - voice = PhoneNumberField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") - fax = PhoneNumberField( + email = models.CharField(null=False, help_text="Contact's email address") + voice = models.CharField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") + fax = models.CharField( null=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", ) From c73e7179bc374032e0db3809f37b6f6a968f92fd Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 6 Mar 2024 15:13:42 -0700 Subject: [PATCH 2/5] added blank to fax field --- src/registrar/models/public_contact.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index 262455c1e..56cda07de 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -72,6 +72,7 @@ class PublicContact(TimeStampedModel): voice = models.CharField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") fax = models.CharField( null=True, + blank=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", ) pw = models.CharField(null=False, help_text="Contact's authorization code. 16 characters minimum.") From a166281cd296ec1cc08d6ede6508456003b4d976 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Wed, 6 Mar 2024 15:19:04 -0700 Subject: [PATCH 3/5] Remove merge error --- src/registrar/models/public_contact.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index b479706b8..52d38d565 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -68,7 +68,6 @@ class PublicContact(TimeStampedModel): sp = models.CharField(null=False, help_text="Contact's state or province") pc = models.CharField(null=False, help_text="Contact's postal code") cc = models.CharField(null=False, help_text="Contact's country code") - email = models.CharField(null=False, help_text="Contact's email address") email = models.EmailField(null=False, help_text="Contact's email address") voice = models.CharField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") fax = models.CharField( From db4919cc09e717e895998e318e406a0ebf7b58e3 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Thu, 14 Mar 2024 12:48:16 -0600 Subject: [PATCH 4/5] linted --- src/registrar/models/public_contact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index 52d38d565..f9dea3f02 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -72,7 +72,7 @@ class PublicContact(TimeStampedModel): voice = models.CharField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") fax = models.CharField( null=True, - blank=True, + blank=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", ) pw = models.CharField(null=False, help_text="Contact's authorization code. 16 characters minimum.") From 6816ed1b91364273b363fda45c5282b1c8180e11 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:53:46 -0600 Subject: [PATCH 5/5] Create 0077_alter_publiccontact_fax_alter_publiccontact_org_and_more.py --- ...ct_fax_alter_publiccontact_org_and_more.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/registrar/migrations/0077_alter_publiccontact_fax_alter_publiccontact_org_and_more.py diff --git a/src/registrar/migrations/0077_alter_publiccontact_fax_alter_publiccontact_org_and_more.py b/src/registrar/migrations/0077_alter_publiccontact_fax_alter_publiccontact_org_and_more.py new file mode 100644 index 000000000..66c904391 --- /dev/null +++ b/src/registrar/migrations/0077_alter_publiccontact_fax_alter_publiccontact_org_and_more.py @@ -0,0 +1,35 @@ +# Generated by Django 4.2.10 on 2024-03-15 18:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("registrar", "0076_alter_domainrequest_current_websites_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="publiccontact", + name="fax", + field=models.CharField( + blank=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", null=True + ), + ), + migrations.AlterField( + model_name="publiccontact", + name="org", + field=models.CharField(blank=True, help_text="Contact's organization (null ok)", null=True), + ), + migrations.AlterField( + model_name="publiccontact", + name="street2", + field=models.CharField(blank=True, help_text="Contact's street (null ok)", null=True), + ), + migrations.AlterField( + model_name="publiccontact", + name="street3", + field=models.CharField(blank=True, help_text="Contact's street (null ok)", null=True), + ), + ]