From cc2e24d4517cec260332a2cd565b583392f0f003 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Fri, 23 Feb 2024 15:44:54 -0700 Subject: [PATCH 1/6] Updated model fields that had unnecessarily large textAreas for inputs. They are now charFields, which are better sized --- src/registrar/models/contact.py | 8 +++--- src/registrar/models/domain_application.py | 16 ++++++------ src/registrar/models/domain_information.py | 14 +++++------ src/registrar/models/public_contact.py | 26 +++++++++---------- src/registrar/models/transition_domain.py | 29 +++++++++++----------- 5 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/registrar/models/contact.py b/src/registrar/models/contact.py index fae06958e..7470ff3f0 100644 --- a/src/registrar/models/contact.py +++ b/src/registrar/models/contact.py @@ -15,23 +15,23 @@ class Contact(TimeStampedModel): on_delete=models.SET_NULL, ) - first_name = models.TextField( + first_name = models.CharField( null=True, blank=True, verbose_name="first name / given name", db_index=True, ) - middle_name = models.TextField( + middle_name = models.CharField( null=True, blank=True, ) - last_name = models.TextField( + last_name = models.CharField( null=True, blank=True, verbose_name="last name / family name", db_index=True, ) - title = models.TextField( + title = models.CharField( null=True, blank=True, verbose_name="title or role in your organization", diff --git a/src/registrar/models/domain_application.py b/src/registrar/models/domain_application.py index 17bc71cbe..ff44d919b 100644 --- a/src/registrar/models/domain_application.py +++ b/src/registrar/models/domain_application.py @@ -391,13 +391,13 @@ class BranchChoices(models.TextChoices): help_text="Is the tribe recognized by a state", ) - tribe_name = models.TextField( + tribe_name = models.CharField( null=True, blank=True, help_text="Name of tribe", ) - federal_agency = models.TextField( + federal_agency = models.CharField( choices=AGENCY_CHOICES, null=True, blank=True, @@ -418,25 +418,25 @@ class BranchChoices(models.TextChoices): help_text="Is your organization an election office?", ) - organization_name = models.TextField( + organization_name = models.CharField( null=True, blank=True, help_text="Organization name", db_index=True, ) - address_line1 = models.TextField( + address_line1 = models.CharField( null=True, blank=True, help_text="Street address", verbose_name="Address line 1", ) - address_line2 = models.TextField( + address_line2 = models.CharField( null=True, blank=True, help_text="Street address line 2 (optional)", verbose_name="Address line 2", ) - city = models.TextField( + city = models.CharField( null=True, blank=True, help_text="City", @@ -455,13 +455,13 @@ class BranchChoices(models.TextChoices): help_text="Zip code", db_index=True, ) - urbanization = models.TextField( + urbanization = models.CharField( null=True, blank=True, help_text="Urbanization (required for Puerto Rico only)", ) - about_your_organization = models.TextField( + about_your_organization = models.CharField( null=True, blank=True, help_text="Information about your organization", diff --git a/src/registrar/models/domain_information.py b/src/registrar/models/domain_information.py index acaa330bb..4bb334cf6 100644 --- a/src/registrar/models/domain_information.py +++ b/src/registrar/models/domain_information.py @@ -67,13 +67,13 @@ class DomainInformation(TimeStampedModel): help_text="Is the tribe recognized by a state", ) - tribe_name = models.TextField( + tribe_name = models.CharField( null=True, blank=True, help_text="Name of tribe", ) - federal_agency = models.TextField( + federal_agency = models.CharField( choices=AGENCY_CHOICES, null=True, blank=True, @@ -94,25 +94,25 @@ class DomainInformation(TimeStampedModel): help_text="Is your organization an election office?", ) - organization_name = models.TextField( + organization_name = models.CharField( null=True, blank=True, help_text="Organization name", db_index=True, ) - address_line1 = models.TextField( + address_line1 = models.CharField( null=True, blank=True, help_text="Street address", verbose_name="Street address", ) - address_line2 = models.TextField( + address_line2 = models.CharField( null=True, blank=True, help_text="Street address line 2 (optional)", verbose_name="Street address line 2 (optional)", ) - city = models.TextField( + city = models.CharField( null=True, blank=True, help_text="City", @@ -132,7 +132,7 @@ class DomainInformation(TimeStampedModel): help_text="Zip code", db_index=True, ) - urbanization = models.TextField( + urbanization = models.CharField( null=True, blank=True, help_text="Urbanization (required for Puerto Rico only)", diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index 08891fa97..ecd7e4d66 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -59,22 +59,22 @@ def save(self, *args, **kwargs): related_name="contacts", ) - name = models.TextField(null=False, help_text="Contact's full name") - org = models.TextField(null=True, help_text="Contact's organization (null ok)") - street1 = models.TextField(null=False, help_text="Contact's street") - street2 = models.TextField(null=True, help_text="Contact's street (null ok)") - street3 = models.TextField(null=True, help_text="Contact's street (null ok)") - city = models.TextField(null=False, help_text="Contact's city") - sp = models.TextField(null=False, help_text="Contact's state or province") - pc = models.TextField(null=False, help_text="Contact's postal code") - cc = models.TextField(null=False, help_text="Contact's country code") - email = models.TextField(null=False, help_text="Contact's email address") - voice = models.TextField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") - fax = models.TextField( + name = models.CharField(null=False, help_text="Contact's full name") + org = models.CharField(null=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)") + 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 = models.PhoneNumberField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") + fax = models.PhoneNumberField( null=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", ) - pw = models.TextField(null=False, help_text="Contact's authorization code. 16 characters minimum.") + pw = models.CharField(null=False, help_text="Contact's authorization code. 16 characters minimum.") @classmethod def get_default_registrant(cls): diff --git a/src/registrar/models/transition_domain.py b/src/registrar/models/transition_domain.py index 915b97d56..56f5f85f8 100644 --- a/src/registrar/models/transition_domain.py +++ b/src/registrar/models/transition_domain.py @@ -1,5 +1,6 @@ from django.db import models from .utility.time_stamped_model import TimeStampedModel +from phonenumber_field.modelfields import PhoneNumberField # type: ignore class StatusChoices(models.TextChoices): @@ -17,13 +18,13 @@ class TransitionDomain(TimeStampedModel): # classes that import TransitionDomain StatusChoices = StatusChoices - username = models.TextField( + username = models.CharField( null=False, blank=False, verbose_name="Username", help_text="Username - this will be an email address", ) - domain_name = models.TextField( + domain_name = models.CharField( null=True, blank=True, verbose_name="Domain name", @@ -49,25 +50,25 @@ class TransitionDomain(TimeStampedModel): verbose_name="Processed", help_text="Indicates whether this TransitionDomain was already processed", ) - organization_type = models.TextField( + organization_type = models.CharField( max_length=255, null=True, blank=True, help_text="Type of organization", ) - organization_name = models.TextField( + organization_name = models.CharField( null=True, blank=True, help_text="Organization name", db_index=True, ) - federal_type = models.TextField( + federal_type = models.CharField( max_length=50, null=True, blank=True, help_text="Federal government branch", ) - federal_agency = models.TextField( + federal_agency = models.CharField( null=True, blank=True, help_text="Federal agency", @@ -80,44 +81,44 @@ class TransitionDomain(TimeStampedModel): null=True, help_text=("Duplication of registry's expiration " "date saved for ease of reporting"), ) - first_name = models.TextField( + first_name = models.CharField( null=True, blank=True, help_text="First name", verbose_name="first name / given name", db_index=True, ) - middle_name = models.TextField( + middle_name = models.CharField( null=True, blank=True, help_text="Middle name (optional)", ) - last_name = models.TextField( + last_name = models.CharField( null=True, blank=True, help_text="Last name", ) - title = models.TextField( + title = models.CharField( null=True, blank=True, help_text="Title", ) - email = models.TextField( + email = models.EmailField( null=True, blank=True, help_text="Email", ) - phone = models.TextField( + phone = models.PhoneNumberField( null=True, blank=True, help_text="Phone", ) - address_line = models.TextField( + address_line = models.CharField( null=True, blank=True, help_text="Street address", ) - city = models.TextField( + city = models.CharField( null=True, blank=True, help_text="City", From 183c4cdeb7838e5a8ddc8fb0c6fb29de341b2eba Mon Sep 17 00:00:00 2001 From: CocoByte Date: Fri, 23 Feb 2024 16:30:50 -0700 Subject: [PATCH 2/6] Fixed models and added migrations --- ...t_name_alter_contact_last_name_and_more.py | 866 ++++++++++++++++++ src/registrar/models/contact.py | 4 +- src/registrar/models/domain_application.py | 2 +- src/registrar/models/domain_information.py | 2 + src/registrar/models/public_contact.py | 5 +- src/registrar/models/transition_domain.py | 2 +- src/registrar/models/user_domain_role.py | 2 + 7 files changed, 877 insertions(+), 6 deletions(-) create mode 100644 src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py diff --git a/src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py b/src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py new file mode 100644 index 000000000..1eb479b45 --- /dev/null +++ b/src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py @@ -0,0 +1,866 @@ +# Generated by Django 4.2.10 on 2024-02-23 23:30 + +from django.db import migrations, models +import phonenumber_field.modelfields + + +class Migration(migrations.Migration): + + dependencies = [ + ("registrar", "0069_alter_contact_email_alter_contact_first_name_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="contact", + name="first_name", + field=models.CharField(blank=True, db_index=True, null=True, verbose_name="first name / given name"), + ), + migrations.AlterField( + model_name="contact", + name="last_name", + field=models.CharField(blank=True, db_index=True, null=True, verbose_name="last name / family name"), + ), + migrations.AlterField( + model_name="contact", + name="middle_name", + field=models.CharField(blank=True, null=True), + ), + migrations.AlterField( + model_name="contact", + name="title", + field=models.CharField(blank=True, null=True, verbose_name="title or role in your organization"), + ), + migrations.AlterField( + model_name="domainapplication", + name="address_line1", + field=models.CharField(blank=True, help_text="Street address", null=True, verbose_name="Address line 1"), + ), + migrations.AlterField( + model_name="domainapplication", + name="address_line2", + field=models.CharField( + blank=True, help_text="Street address line 2 (optional)", null=True, verbose_name="Address line 2" + ), + ), + migrations.AlterField( + model_name="domainapplication", + name="city", + field=models.CharField(blank=True, help_text="City", null=True), + ), + migrations.AlterField( + model_name="domainapplication", + name="federal_agency", + field=models.CharField( + blank=True, + choices=[ + ( + "Administrative Conference of the United States", + "Administrative Conference of the United States", + ), + ("Advisory Council on Historic Preservation", "Advisory Council on Historic Preservation"), + ("American Battle Monuments Commission", "American Battle Monuments Commission"), + ("AMTRAK", "AMTRAK"), + ("Appalachian Regional Commission", "Appalachian Regional Commission"), + ( + "Appraisal Subcommittee of the Federal Financial Institutions Examination Council", + "Appraisal Subcommittee of the Federal Financial Institutions Examination Council", + ), + ("Appraisal Subcommittee", "Appraisal Subcommittee"), + ("Architect of the Capitol", "Architect of the Capitol"), + ("Armed Forces Retirement Home", "Armed Forces Retirement Home"), + ( + "Barry Goldwater Scholarship and Excellence in Education Foundation", + "Barry Goldwater Scholarship and Excellence in Education Foundation", + ), + ( + "Barry Goldwater Scholarship and Excellence in Education Program", + "Barry Goldwater Scholarship and Excellence in Education Program", + ), + ("Central Intelligence Agency", "Central Intelligence Agency"), + ("Chemical Safety Board", "Chemical Safety Board"), + ("Christopher Columbus Fellowship Foundation", "Christopher Columbus Fellowship Foundation"), + ("Civil Rights Cold Case Records Review Board", "Civil Rights Cold Case Records Review Board"), + ( + "Commission for the Preservation of America's Heritage Abroad", + "Commission for the Preservation of America's Heritage Abroad", + ), + ("Commission of Fine Arts", "Commission of Fine Arts"), + ( + "Committee for Purchase From People Who Are Blind or Severely Disabled", + "Committee for Purchase From People Who Are Blind or Severely Disabled", + ), + ("Commodity Futures Trading Commission", "Commodity Futures Trading Commission"), + ("Congressional Budget Office", "Congressional Budget Office"), + ("Consumer Financial Protection Bureau", "Consumer Financial Protection Bureau"), + ("Consumer Product Safety Commission", "Consumer Product Safety Commission"), + ("Corporation for National & Community Service", "Corporation for National & Community Service"), + ( + "Corporation for National and Community Service", + "Corporation for National and Community Service", + ), + ( + "Council of Inspectors General on Integrity and Efficiency", + "Council of Inspectors General on Integrity and Efficiency", + ), + ("Court Services and Offender Supervision", "Court Services and Offender Supervision"), + ("Cyberspace Solarium Commission", "Cyberspace Solarium Commission"), + ( + "DC Court Services and Offender Supervision Agency", + "DC Court Services and Offender Supervision Agency", + ), + ("DC Pre-trial Services", "DC Pre-trial Services"), + ("Defense Nuclear Facilities Safety Board", "Defense Nuclear Facilities Safety Board"), + ("Delta Regional Authority", "Delta Regional Authority"), + ("Denali Commission", "Denali Commission"), + ("Department of Agriculture", "Department of Agriculture"), + ("Department of Commerce", "Department of Commerce"), + ("Department of Defense", "Department of Defense"), + ("Department of Education", "Department of Education"), + ("Department of Energy", "Department of Energy"), + ("Department of Health and Human Services", "Department of Health and Human Services"), + ("Department of Homeland Security", "Department of Homeland Security"), + ("Department of Housing and Urban Development", "Department of Housing and Urban Development"), + ("Department of Justice", "Department of Justice"), + ("Department of Labor", "Department of Labor"), + ("Department of State", "Department of State"), + ("Department of the Interior", "Department of the Interior"), + ("Department of the Treasury", "Department of the Treasury"), + ("Department of Transportation", "Department of Transportation"), + ("Department of Veterans Affairs", "Department of Veterans Affairs"), + ("Director of National Intelligence", "Director of National Intelligence"), + ("Dwight D. Eisenhower Memorial Commission", "Dwight D. Eisenhower Memorial Commission"), + ("Election Assistance Commission", "Election Assistance Commission"), + ("Environmental Protection Agency", "Environmental Protection Agency"), + ("Equal Employment Opportunity Commission", "Equal Employment Opportunity Commission"), + ("Executive Office of the President", "Executive Office of the President"), + ("Export-Import Bank of the United States", "Export-Import Bank of the United States"), + ("Export/Import Bank of the U.S.", "Export/Import Bank of the U.S."), + ("Farm Credit Administration", "Farm Credit Administration"), + ("Farm Credit System Insurance Corporation", "Farm Credit System Insurance Corporation"), + ("Federal Communications Commission", "Federal Communications Commission"), + ("Federal Deposit Insurance Corporation", "Federal Deposit Insurance Corporation"), + ("Federal Election Commission", "Federal Election Commission"), + ("Federal Energy Regulatory Commission", "Federal Energy Regulatory Commission"), + ( + "Federal Financial Institutions Examination Council", + "Federal Financial Institutions Examination Council", + ), + ("Federal Housing Finance Agency", "Federal Housing Finance Agency"), + ("Federal Judiciary", "Federal Judiciary"), + ("Federal Labor Relations Authority", "Federal Labor Relations Authority"), + ("Federal Maritime Commission", "Federal Maritime Commission"), + ("Federal Mediation and Conciliation Service", "Federal Mediation and Conciliation Service"), + ( + "Federal Mine Safety and Health Review Commission", + "Federal Mine Safety and Health Review Commission", + ), + ( + "Federal Permitting Improvement Steering Council", + "Federal Permitting Improvement Steering Council", + ), + ("Federal Reserve Board of Governors", "Federal Reserve Board of Governors"), + ("Federal Reserve System", "Federal Reserve System"), + ("Federal Trade Commission", "Federal Trade Commission"), + ("General Services Administration", "General Services Administration"), + ("gov Administration", "gov Administration"), + ("Government Accountability Office", "Government Accountability Office"), + ("Government Publishing Office", "Government Publishing Office"), + ("Gulf Coast Ecosystem Restoration Council", "Gulf Coast Ecosystem Restoration Council"), + ("Harry S Truman Scholarship Foundation", "Harry S Truman Scholarship Foundation"), + ("Harry S. Truman Scholarship Foundation", "Harry S. Truman Scholarship Foundation"), + ("Institute of Museum and Library Services", "Institute of Museum and Library Services"), + ("Institute of Peace", "Institute of Peace"), + ("Inter-American Foundation", "Inter-American Foundation"), + ( + "International Boundary and Water Commission: United States and Mexico", + "International Boundary and Water Commission: United States and Mexico", + ), + ( + "International Boundary Commission: United States and Canada", + "International Boundary Commission: United States and Canada", + ), + ( + "International Joint Commission: United States and Canada", + "International Joint Commission: United States and Canada", + ), + ("James Madison Memorial Fellowship Foundation", "James Madison Memorial Fellowship Foundation"), + ("Japan-United States Friendship Commission", "Japan-United States Friendship Commission"), + ("Japan-US Friendship Commission", "Japan-US Friendship Commission"), + ("John F. Kennedy Center for Performing Arts", "John F. Kennedy Center for Performing Arts"), + ( + "John F. Kennedy Center for the Performing Arts", + "John F. Kennedy Center for the Performing Arts", + ), + ("Legal Services Corporation", "Legal Services Corporation"), + ("Legislative Branch", "Legislative Branch"), + ("Library of Congress", "Library of Congress"), + ("Marine Mammal Commission", "Marine Mammal Commission"), + ( + "Medicaid and CHIP Payment and Access Commission", + "Medicaid and CHIP Payment and Access Commission", + ), + ("Medical Payment Advisory Commission", "Medical Payment Advisory Commission"), + ("Medicare Payment Advisory Commission", "Medicare Payment Advisory Commission"), + ("Merit Systems Protection Board", "Merit Systems Protection Board"), + ("Millennium Challenge Corporation", "Millennium Challenge Corporation"), + ( + "Morris K. Udall and Stewart L. Udall Foundation", + "Morris K. Udall and Stewart L. Udall Foundation", + ), + ("National Aeronautics and Space Administration", "National Aeronautics and Space Administration"), + ("National Archives and Records Administration", "National Archives and Records Administration"), + ("National Capital Planning Commission", "National Capital Planning Commission"), + ("National Council on Disability", "National Council on Disability"), + ("National Credit Union Administration", "National Credit Union Administration"), + ("National Endowment for the Arts", "National Endowment for the Arts"), + ("National Endowment for the Humanities", "National Endowment for the Humanities"), + ( + "National Foundation on the Arts and the Humanities", + "National Foundation on the Arts and the Humanities", + ), + ("National Gallery of Art", "National Gallery of Art"), + ("National Indian Gaming Commission", "National Indian Gaming Commission"), + ("National Labor Relations Board", "National Labor Relations Board"), + ("National Mediation Board", "National Mediation Board"), + ("National Science Foundation", "National Science Foundation"), + ( + "National Security Commission on Artificial Intelligence", + "National Security Commission on Artificial Intelligence", + ), + ("National Transportation Safety Board", "National Transportation Safety Board"), + ( + "Networking Information Technology Research and Development", + "Networking Information Technology Research and Development", + ), + ("Non-Federal Agency", "Non-Federal Agency"), + ("Northern Border Regional Commission", "Northern Border Regional Commission"), + ("Nuclear Regulatory Commission", "Nuclear Regulatory Commission"), + ("Nuclear Safety Oversight Committee", "Nuclear Safety Oversight Committee"), + ("Nuclear Waste Technical Review Board", "Nuclear Waste Technical Review Board"), + ( + "Occupational Safety & Health Review Commission", + "Occupational Safety & Health Review Commission", + ), + ( + "Occupational Safety and Health Review Commission", + "Occupational Safety and Health Review Commission", + ), + ("Office of Compliance", "Office of Compliance"), + ("Office of Congressional Workplace Rights", "Office of Congressional Workplace Rights"), + ("Office of Government Ethics", "Office of Government Ethics"), + ("Office of Navajo and Hopi Indian Relocation", "Office of Navajo and Hopi Indian Relocation"), + ("Office of Personnel Management", "Office of Personnel Management"), + ("Open World Leadership Center", "Open World Leadership Center"), + ("Overseas Private Investment Corporation", "Overseas Private Investment Corporation"), + ("Peace Corps", "Peace Corps"), + ("Pension Benefit Guaranty Corporation", "Pension Benefit Guaranty Corporation"), + ("Postal Regulatory Commission", "Postal Regulatory Commission"), + ("Presidio Trust", "Presidio Trust"), + ("Privacy and Civil Liberties Oversight Board", "Privacy and Civil Liberties Oversight Board"), + ("Public Buildings Reform Board", "Public Buildings Reform Board"), + ( + "Public Defender Service for the District of Columbia", + "Public Defender Service for the District of Columbia", + ), + ("Railroad Retirement Board", "Railroad Retirement Board"), + ("Securities and Exchange Commission", "Securities and Exchange Commission"), + ("Selective Service System", "Selective Service System"), + ("Small Business Administration", "Small Business Administration"), + ("Smithsonian Institution", "Smithsonian Institution"), + ("Social Security Administration", "Social Security Administration"), + ("Social Security Advisory Board", "Social Security Advisory Board"), + ("Southeast Crescent Regional Commission", "Southeast Crescent Regional Commission"), + ("Southwest Border Regional Commission", "Southwest Border Regional Commission"), + ("State Justice Institute", "State Justice Institute"), + ("State, Local, and Tribal Government", "State, Local, and Tribal Government"), + ("Stennis Center for Public Service", "Stennis Center for Public Service"), + ("Surface Transportation Board", "Surface Transportation Board"), + ("Tennessee Valley Authority", "Tennessee Valley Authority"), + ("The Executive Office of the President", "The Executive Office of the President"), + ("The Intelligence Community", "The Intelligence Community"), + ("The Legislative Branch", "The Legislative Branch"), + ("The Supreme Court", "The Supreme Court"), + ( + "The United States World War One Centennial Commission", + "The United States World War One Centennial Commission", + ), + ("U.S. Access Board", "U.S. Access Board"), + ("U.S. Agency for Global Media", "U.S. Agency for Global Media"), + ("U.S. Agency for International Development", "U.S. Agency for International Development"), + ("U.S. Capitol Police", "U.S. Capitol Police"), + ("U.S. Chemical Safety Board", "U.S. Chemical Safety Board"), + ( + "U.S. China Economic and Security Review Commission", + "U.S. China Economic and Security Review Commission", + ), + ( + "U.S. Commission for the Preservation of Americas Heritage Abroad", + "U.S. Commission for the Preservation of Americas Heritage Abroad", + ), + ("U.S. Commission of Fine Arts", "U.S. Commission of Fine Arts"), + ("U.S. Commission on Civil Rights", "U.S. Commission on Civil Rights"), + ( + "U.S. Commission on International Religious Freedom", + "U.S. Commission on International Religious Freedom", + ), + ("U.S. Courts", "U.S. Courts"), + ("U.S. Department of Agriculture", "U.S. Department of Agriculture"), + ("U.S. Interagency Council on Homelessness", "U.S. Interagency Council on Homelessness"), + ("U.S. International Trade Commission", "U.S. International Trade Commission"), + ("U.S. Nuclear Waste Technical Review Board", "U.S. Nuclear Waste Technical Review Board"), + ("U.S. Office of Special Counsel", "U.S. Office of Special Counsel"), + ("U.S. Peace Corps", "U.S. Peace Corps"), + ("U.S. Postal Service", "U.S. Postal Service"), + ("U.S. Semiquincentennial Commission", "U.S. Semiquincentennial Commission"), + ("U.S. Trade and Development Agency", "U.S. Trade and Development Agency"), + ( + "U.S.-China Economic and Security Review Commission", + "U.S.-China Economic and Security Review Commission", + ), + ("Udall Foundation", "Udall Foundation"), + ("United States AbilityOne", "United States AbilityOne"), + ("United States Access Board", "United States Access Board"), + ("United States African Development Foundation", "United States African Development Foundation"), + ("United States Agency for Global Media", "United States Agency for Global Media"), + ("United States Arctic Research Commission", "United States Arctic Research Commission"), + ("United States Global Change Research Program", "United States Global Change Research Program"), + ("United States Holocaust Memorial Museum", "United States Holocaust Memorial Museum"), + ("United States Institute of Peace", "United States Institute of Peace"), + ( + "United States Interagency Council on Homelessness", + "United States Interagency Council on Homelessness", + ), + ( + "United States International Development Finance Corporation", + "United States International Development Finance Corporation", + ), + ("United States International Trade Commission", "United States International Trade Commission"), + ("United States Postal Service", "United States Postal Service"), + ("United States Senate", "United States Senate"), + ("United States Trade and Development Agency", "United States Trade and Development Agency"), + ( + "Utah Reclamation Mitigation and Conservation Commission", + "Utah Reclamation Mitigation and Conservation Commission", + ), + ("Vietnam Education Foundation", "Vietnam Education Foundation"), + ("Western Hemisphere Drug Policy Commission", "Western Hemisphere Drug Policy Commission"), + ( + "Woodrow Wilson International Center for Scholars", + "Woodrow Wilson International Center for Scholars", + ), + ("World War I Centennial Commission", "World War I Centennial Commission"), + ], + help_text="Federal agency", + null=True, + ), + ), + migrations.AlterField( + model_name="domainapplication", + name="organization_name", + field=models.CharField(blank=True, db_index=True, help_text="Organization name", null=True), + ), + migrations.AlterField( + model_name="domainapplication", + name="tribe_name", + field=models.CharField(blank=True, help_text="Name of tribe", null=True), + ), + migrations.AlterField( + model_name="domainapplication", + name="urbanization", + field=models.CharField(blank=True, help_text="Urbanization (required for Puerto Rico only)", null=True), + ), + migrations.AlterField( + model_name="domaininformation", + name="address_line1", + field=models.CharField(blank=True, help_text="Street address", null=True, verbose_name="Street address"), + ), + migrations.AlterField( + model_name="domaininformation", + name="address_line2", + field=models.CharField( + blank=True, + help_text="Street address line 2 (optional)", + null=True, + verbose_name="Street address line 2 (optional)", + ), + ), + migrations.AlterField( + model_name="domaininformation", + name="city", + field=models.CharField(blank=True, help_text="City", null=True), + ), + migrations.AlterField( + model_name="domaininformation", + name="federal_agency", + field=models.CharField( + blank=True, + choices=[ + ( + "Administrative Conference of the United States", + "Administrative Conference of the United States", + ), + ("Advisory Council on Historic Preservation", "Advisory Council on Historic Preservation"), + ("American Battle Monuments Commission", "American Battle Monuments Commission"), + ("AMTRAK", "AMTRAK"), + ("Appalachian Regional Commission", "Appalachian Regional Commission"), + ( + "Appraisal Subcommittee of the Federal Financial Institutions Examination Council", + "Appraisal Subcommittee of the Federal Financial Institutions Examination Council", + ), + ("Appraisal Subcommittee", "Appraisal Subcommittee"), + ("Architect of the Capitol", "Architect of the Capitol"), + ("Armed Forces Retirement Home", "Armed Forces Retirement Home"), + ( + "Barry Goldwater Scholarship and Excellence in Education Foundation", + "Barry Goldwater Scholarship and Excellence in Education Foundation", + ), + ( + "Barry Goldwater Scholarship and Excellence in Education Program", + "Barry Goldwater Scholarship and Excellence in Education Program", + ), + ("Central Intelligence Agency", "Central Intelligence Agency"), + ("Chemical Safety Board", "Chemical Safety Board"), + ("Christopher Columbus Fellowship Foundation", "Christopher Columbus Fellowship Foundation"), + ("Civil Rights Cold Case Records Review Board", "Civil Rights Cold Case Records Review Board"), + ( + "Commission for the Preservation of America's Heritage Abroad", + "Commission for the Preservation of America's Heritage Abroad", + ), + ("Commission of Fine Arts", "Commission of Fine Arts"), + ( + "Committee for Purchase From People Who Are Blind or Severely Disabled", + "Committee for Purchase From People Who Are Blind or Severely Disabled", + ), + ("Commodity Futures Trading Commission", "Commodity Futures Trading Commission"), + ("Congressional Budget Office", "Congressional Budget Office"), + ("Consumer Financial Protection Bureau", "Consumer Financial Protection Bureau"), + ("Consumer Product Safety Commission", "Consumer Product Safety Commission"), + ("Corporation for National & Community Service", "Corporation for National & Community Service"), + ( + "Corporation for National and Community Service", + "Corporation for National and Community Service", + ), + ( + "Council of Inspectors General on Integrity and Efficiency", + "Council of Inspectors General on Integrity and Efficiency", + ), + ("Court Services and Offender Supervision", "Court Services and Offender Supervision"), + ("Cyberspace Solarium Commission", "Cyberspace Solarium Commission"), + ( + "DC Court Services and Offender Supervision Agency", + "DC Court Services and Offender Supervision Agency", + ), + ("DC Pre-trial Services", "DC Pre-trial Services"), + ("Defense Nuclear Facilities Safety Board", "Defense Nuclear Facilities Safety Board"), + ("Delta Regional Authority", "Delta Regional Authority"), + ("Denali Commission", "Denali Commission"), + ("Department of Agriculture", "Department of Agriculture"), + ("Department of Commerce", "Department of Commerce"), + ("Department of Defense", "Department of Defense"), + ("Department of Education", "Department of Education"), + ("Department of Energy", "Department of Energy"), + ("Department of Health and Human Services", "Department of Health and Human Services"), + ("Department of Homeland Security", "Department of Homeland Security"), + ("Department of Housing and Urban Development", "Department of Housing and Urban Development"), + ("Department of Justice", "Department of Justice"), + ("Department of Labor", "Department of Labor"), + ("Department of State", "Department of State"), + ("Department of the Interior", "Department of the Interior"), + ("Department of the Treasury", "Department of the Treasury"), + ("Department of Transportation", "Department of Transportation"), + ("Department of Veterans Affairs", "Department of Veterans Affairs"), + ("Director of National Intelligence", "Director of National Intelligence"), + ("Dwight D. Eisenhower Memorial Commission", "Dwight D. Eisenhower Memorial Commission"), + ("Election Assistance Commission", "Election Assistance Commission"), + ("Environmental Protection Agency", "Environmental Protection Agency"), + ("Equal Employment Opportunity Commission", "Equal Employment Opportunity Commission"), + ("Executive Office of the President", "Executive Office of the President"), + ("Export-Import Bank of the United States", "Export-Import Bank of the United States"), + ("Export/Import Bank of the U.S.", "Export/Import Bank of the U.S."), + ("Farm Credit Administration", "Farm Credit Administration"), + ("Farm Credit System Insurance Corporation", "Farm Credit System Insurance Corporation"), + ("Federal Communications Commission", "Federal Communications Commission"), + ("Federal Deposit Insurance Corporation", "Federal Deposit Insurance Corporation"), + ("Federal Election Commission", "Federal Election Commission"), + ("Federal Energy Regulatory Commission", "Federal Energy Regulatory Commission"), + ( + "Federal Financial Institutions Examination Council", + "Federal Financial Institutions Examination Council", + ), + ("Federal Housing Finance Agency", "Federal Housing Finance Agency"), + ("Federal Judiciary", "Federal Judiciary"), + ("Federal Labor Relations Authority", "Federal Labor Relations Authority"), + ("Federal Maritime Commission", "Federal Maritime Commission"), + ("Federal Mediation and Conciliation Service", "Federal Mediation and Conciliation Service"), + ( + "Federal Mine Safety and Health Review Commission", + "Federal Mine Safety and Health Review Commission", + ), + ( + "Federal Permitting Improvement Steering Council", + "Federal Permitting Improvement Steering Council", + ), + ("Federal Reserve Board of Governors", "Federal Reserve Board of Governors"), + ("Federal Reserve System", "Federal Reserve System"), + ("Federal Trade Commission", "Federal Trade Commission"), + ("General Services Administration", "General Services Administration"), + ("gov Administration", "gov Administration"), + ("Government Accountability Office", "Government Accountability Office"), + ("Government Publishing Office", "Government Publishing Office"), + ("Gulf Coast Ecosystem Restoration Council", "Gulf Coast Ecosystem Restoration Council"), + ("Harry S Truman Scholarship Foundation", "Harry S Truman Scholarship Foundation"), + ("Harry S. Truman Scholarship Foundation", "Harry S. Truman Scholarship Foundation"), + ("Institute of Museum and Library Services", "Institute of Museum and Library Services"), + ("Institute of Peace", "Institute of Peace"), + ("Inter-American Foundation", "Inter-American Foundation"), + ( + "International Boundary and Water Commission: United States and Mexico", + "International Boundary and Water Commission: United States and Mexico", + ), + ( + "International Boundary Commission: United States and Canada", + "International Boundary Commission: United States and Canada", + ), + ( + "International Joint Commission: United States and Canada", + "International Joint Commission: United States and Canada", + ), + ("James Madison Memorial Fellowship Foundation", "James Madison Memorial Fellowship Foundation"), + ("Japan-United States Friendship Commission", "Japan-United States Friendship Commission"), + ("Japan-US Friendship Commission", "Japan-US Friendship Commission"), + ("John F. Kennedy Center for Performing Arts", "John F. Kennedy Center for Performing Arts"), + ( + "John F. Kennedy Center for the Performing Arts", + "John F. Kennedy Center for the Performing Arts", + ), + ("Legal Services Corporation", "Legal Services Corporation"), + ("Legislative Branch", "Legislative Branch"), + ("Library of Congress", "Library of Congress"), + ("Marine Mammal Commission", "Marine Mammal Commission"), + ( + "Medicaid and CHIP Payment and Access Commission", + "Medicaid and CHIP Payment and Access Commission", + ), + ("Medical Payment Advisory Commission", "Medical Payment Advisory Commission"), + ("Medicare Payment Advisory Commission", "Medicare Payment Advisory Commission"), + ("Merit Systems Protection Board", "Merit Systems Protection Board"), + ("Millennium Challenge Corporation", "Millennium Challenge Corporation"), + ( + "Morris K. Udall and Stewart L. Udall Foundation", + "Morris K. Udall and Stewart L. Udall Foundation", + ), + ("National Aeronautics and Space Administration", "National Aeronautics and Space Administration"), + ("National Archives and Records Administration", "National Archives and Records Administration"), + ("National Capital Planning Commission", "National Capital Planning Commission"), + ("National Council on Disability", "National Council on Disability"), + ("National Credit Union Administration", "National Credit Union Administration"), + ("National Endowment for the Arts", "National Endowment for the Arts"), + ("National Endowment for the Humanities", "National Endowment for the Humanities"), + ( + "National Foundation on the Arts and the Humanities", + "National Foundation on the Arts and the Humanities", + ), + ("National Gallery of Art", "National Gallery of Art"), + ("National Indian Gaming Commission", "National Indian Gaming Commission"), + ("National Labor Relations Board", "National Labor Relations Board"), + ("National Mediation Board", "National Mediation Board"), + ("National Science Foundation", "National Science Foundation"), + ( + "National Security Commission on Artificial Intelligence", + "National Security Commission on Artificial Intelligence", + ), + ("National Transportation Safety Board", "National Transportation Safety Board"), + ( + "Networking Information Technology Research and Development", + "Networking Information Technology Research and Development", + ), + ("Non-Federal Agency", "Non-Federal Agency"), + ("Northern Border Regional Commission", "Northern Border Regional Commission"), + ("Nuclear Regulatory Commission", "Nuclear Regulatory Commission"), + ("Nuclear Safety Oversight Committee", "Nuclear Safety Oversight Committee"), + ("Nuclear Waste Technical Review Board", "Nuclear Waste Technical Review Board"), + ( + "Occupational Safety & Health Review Commission", + "Occupational Safety & Health Review Commission", + ), + ( + "Occupational Safety and Health Review Commission", + "Occupational Safety and Health Review Commission", + ), + ("Office of Compliance", "Office of Compliance"), + ("Office of Congressional Workplace Rights", "Office of Congressional Workplace Rights"), + ("Office of Government Ethics", "Office of Government Ethics"), + ("Office of Navajo and Hopi Indian Relocation", "Office of Navajo and Hopi Indian Relocation"), + ("Office of Personnel Management", "Office of Personnel Management"), + ("Open World Leadership Center", "Open World Leadership Center"), + ("Overseas Private Investment Corporation", "Overseas Private Investment Corporation"), + ("Peace Corps", "Peace Corps"), + ("Pension Benefit Guaranty Corporation", "Pension Benefit Guaranty Corporation"), + ("Postal Regulatory Commission", "Postal Regulatory Commission"), + ("Presidio Trust", "Presidio Trust"), + ("Privacy and Civil Liberties Oversight Board", "Privacy and Civil Liberties Oversight Board"), + ("Public Buildings Reform Board", "Public Buildings Reform Board"), + ( + "Public Defender Service for the District of Columbia", + "Public Defender Service for the District of Columbia", + ), + ("Railroad Retirement Board", "Railroad Retirement Board"), + ("Securities and Exchange Commission", "Securities and Exchange Commission"), + ("Selective Service System", "Selective Service System"), + ("Small Business Administration", "Small Business Administration"), + ("Smithsonian Institution", "Smithsonian Institution"), + ("Social Security Administration", "Social Security Administration"), + ("Social Security Advisory Board", "Social Security Advisory Board"), + ("Southeast Crescent Regional Commission", "Southeast Crescent Regional Commission"), + ("Southwest Border Regional Commission", "Southwest Border Regional Commission"), + ("State Justice Institute", "State Justice Institute"), + ("State, Local, and Tribal Government", "State, Local, and Tribal Government"), + ("Stennis Center for Public Service", "Stennis Center for Public Service"), + ("Surface Transportation Board", "Surface Transportation Board"), + ("Tennessee Valley Authority", "Tennessee Valley Authority"), + ("The Executive Office of the President", "The Executive Office of the President"), + ("The Intelligence Community", "The Intelligence Community"), + ("The Legislative Branch", "The Legislative Branch"), + ("The Supreme Court", "The Supreme Court"), + ( + "The United States World War One Centennial Commission", + "The United States World War One Centennial Commission", + ), + ("U.S. Access Board", "U.S. Access Board"), + ("U.S. Agency for Global Media", "U.S. Agency for Global Media"), + ("U.S. Agency for International Development", "U.S. Agency for International Development"), + ("U.S. Capitol Police", "U.S. Capitol Police"), + ("U.S. Chemical Safety Board", "U.S. Chemical Safety Board"), + ( + "U.S. China Economic and Security Review Commission", + "U.S. China Economic and Security Review Commission", + ), + ( + "U.S. Commission for the Preservation of Americas Heritage Abroad", + "U.S. Commission for the Preservation of Americas Heritage Abroad", + ), + ("U.S. Commission of Fine Arts", "U.S. Commission of Fine Arts"), + ("U.S. Commission on Civil Rights", "U.S. Commission on Civil Rights"), + ( + "U.S. Commission on International Religious Freedom", + "U.S. Commission on International Religious Freedom", + ), + ("U.S. Courts", "U.S. Courts"), + ("U.S. Department of Agriculture", "U.S. Department of Agriculture"), + ("U.S. Interagency Council on Homelessness", "U.S. Interagency Council on Homelessness"), + ("U.S. International Trade Commission", "U.S. International Trade Commission"), + ("U.S. Nuclear Waste Technical Review Board", "U.S. Nuclear Waste Technical Review Board"), + ("U.S. Office of Special Counsel", "U.S. Office of Special Counsel"), + ("U.S. Peace Corps", "U.S. Peace Corps"), + ("U.S. Postal Service", "U.S. Postal Service"), + ("U.S. Semiquincentennial Commission", "U.S. Semiquincentennial Commission"), + ("U.S. Trade and Development Agency", "U.S. Trade and Development Agency"), + ( + "U.S.-China Economic and Security Review Commission", + "U.S.-China Economic and Security Review Commission", + ), + ("Udall Foundation", "Udall Foundation"), + ("United States AbilityOne", "United States AbilityOne"), + ("United States Access Board", "United States Access Board"), + ("United States African Development Foundation", "United States African Development Foundation"), + ("United States Agency for Global Media", "United States Agency for Global Media"), + ("United States Arctic Research Commission", "United States Arctic Research Commission"), + ("United States Global Change Research Program", "United States Global Change Research Program"), + ("United States Holocaust Memorial Museum", "United States Holocaust Memorial Museum"), + ("United States Institute of Peace", "United States Institute of Peace"), + ( + "United States Interagency Council on Homelessness", + "United States Interagency Council on Homelessness", + ), + ( + "United States International Development Finance Corporation", + "United States International Development Finance Corporation", + ), + ("United States International Trade Commission", "United States International Trade Commission"), + ("United States Postal Service", "United States Postal Service"), + ("United States Senate", "United States Senate"), + ("United States Trade and Development Agency", "United States Trade and Development Agency"), + ( + "Utah Reclamation Mitigation and Conservation Commission", + "Utah Reclamation Mitigation and Conservation Commission", + ), + ("Vietnam Education Foundation", "Vietnam Education Foundation"), + ("Western Hemisphere Drug Policy Commission", "Western Hemisphere Drug Policy Commission"), + ( + "Woodrow Wilson International Center for Scholars", + "Woodrow Wilson International Center for Scholars", + ), + ("World War I Centennial Commission", "World War I Centennial Commission"), + ], + help_text="Federal agency", + null=True, + ), + ), + migrations.AlterField( + model_name="domaininformation", + name="organization_name", + field=models.CharField(blank=True, db_index=True, help_text="Organization name", null=True), + ), + migrations.AlterField( + model_name="domaininformation", + name="tribe_name", + field=models.CharField(blank=True, help_text="Name of tribe", null=True), + ), + migrations.AlterField( + model_name="domaininformation", + name="urbanization", + field=models.CharField( + blank=True, + help_text="Urbanization (required for Puerto Rico only)", + null=True, + verbose_name="Urbanization (required for Puerto Rico only)", + ), + ), + migrations.AlterField( + model_name="publiccontact", + name="cc", + field=models.CharField(help_text="Contact's country code"), + ), + migrations.AlterField( + model_name="publiccontact", + name="city", + field=models.CharField(help_text="Contact's city"), + ), + migrations.AlterField( + model_name="publiccontact", + name="email", + field=models.EmailField(help_text="Contact's email address", max_length=254), + ), + migrations.AlterField( + model_name="publiccontact", + name="fax", + field=phonenumber_field.modelfields.PhoneNumberField( + help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", + max_length=128, + null=True, + region=None, + ), + ), + migrations.AlterField( + model_name="publiccontact", + name="name", + field=models.CharField(help_text="Contact's full name"), + ), + migrations.AlterField( + model_name="publiccontact", + name="org", + field=models.CharField(help_text="Contact's organization (null ok)", null=True), + ), + migrations.AlterField( + model_name="publiccontact", + name="pc", + field=models.CharField(help_text="Contact's postal code"), + ), + migrations.AlterField( + model_name="publiccontact", + name="pw", + field=models.CharField(help_text="Contact's authorization code. 16 characters minimum."), + ), + migrations.AlterField( + model_name="publiccontact", + name="sp", + field=models.CharField(help_text="Contact's state or province"), + ), + migrations.AlterField( + model_name="publiccontact", + name="street1", + field=models.CharField(help_text="Contact's street"), + ), + migrations.AlterField( + model_name="publiccontact", + name="street2", + field=models.CharField(help_text="Contact's street (null ok)", null=True), + ), + migrations.AlterField( + model_name="publiccontact", + name="street3", + field=models.CharField(help_text="Contact's street (null ok)", null=True), + ), + migrations.AlterField( + model_name="publiccontact", + name="voice", + field=phonenumber_field.modelfields.PhoneNumberField( + help_text="Contact's phone number. Must be in ITU.E164.2005 format", max_length=128, region=None + ), + ), + migrations.AlterField( + model_name="transitiondomain", + name="address_line", + field=models.CharField(blank=True, help_text="Street address", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="city", + field=models.CharField(blank=True, help_text="City", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="domain_name", + field=models.CharField(blank=True, null=True, verbose_name="Domain name"), + ), + migrations.AlterField( + model_name="transitiondomain", + name="email", + field=models.EmailField(blank=True, help_text="Email", max_length=254, null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="federal_agency", + field=models.CharField(blank=True, help_text="Federal agency", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="federal_type", + field=models.CharField(blank=True, help_text="Federal government branch", max_length=50, null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="first_name", + field=models.CharField( + blank=True, db_index=True, help_text="First name", null=True, verbose_name="first name / given name" + ), + ), + migrations.AlterField( + model_name="transitiondomain", + name="last_name", + field=models.CharField(blank=True, help_text="Last name", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="middle_name", + field=models.CharField(blank=True, help_text="Middle name (optional)", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="organization_name", + field=models.CharField(blank=True, db_index=True, help_text="Organization name", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="organization_type", + field=models.CharField(blank=True, help_text="Type of organization", max_length=255, null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="phone", + field=phonenumber_field.modelfields.PhoneNumberField( + blank=True, help_text="Phone", max_length=128, null=True, region=None + ), + ), + migrations.AlterField( + model_name="transitiondomain", + name="title", + field=models.CharField(blank=True, help_text="Title", null=True), + ), + migrations.AlterField( + model_name="transitiondomain", + name="username", + field=models.CharField(help_text="Username - this will be an email address", verbose_name="Username"), + ), + ] diff --git a/src/registrar/models/contact.py b/src/registrar/models/contact.py index 7470ff3f0..d3de5a293 100644 --- a/src/registrar/models/contact.py +++ b/src/registrar/models/contact.py @@ -1,9 +1,9 @@ from django.db import models -from phonenumber_field.modelfields import PhoneNumberField # type: ignore - from .utility.time_stamped_model import TimeStampedModel +from phonenumber_field.modelfields import PhoneNumberField # type: ignore + class Contact(TimeStampedModel): """Contact information follows a similar pattern for each contact.""" diff --git a/src/registrar/models/domain_application.py b/src/registrar/models/domain_application.py index ff44d919b..2240400e9 100644 --- a/src/registrar/models/domain_application.py +++ b/src/registrar/models/domain_application.py @@ -461,7 +461,7 @@ class BranchChoices(models.TextChoices): help_text="Urbanization (required for Puerto Rico only)", ) - about_your_organization = models.CharField( + about_your_organization = models.TextField( null=True, blank=True, help_text="Information about your organization", diff --git a/src/registrar/models/domain_information.py b/src/registrar/models/domain_information.py index 4bb334cf6..a0d0af780 100644 --- a/src/registrar/models/domain_information.py +++ b/src/registrar/models/domain_information.py @@ -5,6 +5,8 @@ from .domain_application import DomainApplication from .utility.time_stamped_model import TimeStampedModel +from phonenumber_field.modelfields import PhoneNumberField # type: ignore + import logging from django.db import models diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index ecd7e4d66..08443b0a8 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -8,6 +8,7 @@ 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.""" @@ -69,8 +70,8 @@ def save(self, *args, **kwargs): 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 = models.PhoneNumberField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") - fax = models.PhoneNumberField( + voice = PhoneNumberField(null=False, help_text="Contact's phone number. Must be in ITU.E164.2005 format") + fax = PhoneNumberField( null=True, help_text="Contact's fax number (null ok). Must be in ITU.E164.2005 format.", ) diff --git a/src/registrar/models/transition_domain.py b/src/registrar/models/transition_domain.py index 56f5f85f8..c8a952dd4 100644 --- a/src/registrar/models/transition_domain.py +++ b/src/registrar/models/transition_domain.py @@ -108,7 +108,7 @@ class TransitionDomain(TimeStampedModel): blank=True, help_text="Email", ) - phone = models.PhoneNumberField( + phone = PhoneNumberField( null=True, blank=True, help_text="Phone", diff --git a/src/registrar/models/user_domain_role.py b/src/registrar/models/user_domain_role.py index 6e915e4af..d9211bd4f 100644 --- a/src/registrar/models/user_domain_role.py +++ b/src/registrar/models/user_domain_role.py @@ -2,6 +2,8 @@ from .utility.time_stamped_model import TimeStampedModel +from phonenumber_field.modelfields import PhoneNumberField # type: ignore + class UserDomainRole(TimeStampedModel): """This is a linking table that connects a user with a role on a domain.""" From d4927d6cf0b5b2c63ea6fe91f0ef140a774f3374 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 27 Feb 2024 17:11:03 -0700 Subject: [PATCH 3/6] Fixed migrations --- ...er_contact_first_name_alter_contact_last_name_and_more.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/registrar/migrations/{0070_alter_contact_first_name_alter_contact_last_name_and_more.py => 0071_alter_contact_first_name_alter_contact_last_name_and_more.py} (99%) diff --git a/src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py b/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py similarity index 99% rename from src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py rename to src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py index 1eb479b45..28be99564 100644 --- a/src/registrar/migrations/0070_alter_contact_first_name_alter_contact_last_name_and_more.py +++ b/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.10 on 2024-02-23 23:30 +# Generated by Django 4.2.10 on 2024-02-28 00:07 from django.db import migrations, models import phonenumber_field.modelfields @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ("registrar", "0069_alter_contact_email_alter_contact_first_name_and_more"), + ("registrar", "0070_domainapplication_rejection_reason"), ] operations = [ From 2d55a4a4222f64a541822f7032d66039eab4e560 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 27 Feb 2024 17:14:43 -0700 Subject: [PATCH 4/6] linted --- src/registrar/models/domain_information.py | 2 -- src/registrar/models/public_contact.py | 1 + src/registrar/models/user_domain_role.py | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/registrar/models/domain_information.py b/src/registrar/models/domain_information.py index 7e09a6b23..861171c5c 100644 --- a/src/registrar/models/domain_information.py +++ b/src/registrar/models/domain_information.py @@ -5,8 +5,6 @@ from .domain_application import DomainApplication from .utility.time_stamped_model import TimeStampedModel -from phonenumber_field.modelfields import PhoneNumberField # type: ignore - import logging from django.db import models diff --git a/src/registrar/models/public_contact.py b/src/registrar/models/public_contact.py index 08443b0a8..989dfb0cd 100644 --- a/src/registrar/models/public_contact.py +++ b/src/registrar/models/public_contact.py @@ -10,6 +10,7 @@ from phonenumber_field.modelfields import PhoneNumberField # type: ignore + def get_id(): """Generate a 16 character registry ID with a low probability of collision.""" day = datetime.today().strftime("%A")[:2] diff --git a/src/registrar/models/user_domain_role.py b/src/registrar/models/user_domain_role.py index d9211bd4f..6e915e4af 100644 --- a/src/registrar/models/user_domain_role.py +++ b/src/registrar/models/user_domain_role.py @@ -2,8 +2,6 @@ from .utility.time_stamped_model import TimeStampedModel -from phonenumber_field.modelfields import PhoneNumberField # type: ignore - class UserDomainRole(TimeStampedModel): """This is a linking table that connects a user with a role on a domain.""" From 9e04371e26b8d3e17e03cfc6b191efba5df768cd Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 27 Feb 2024 21:20:37 -0700 Subject: [PATCH 5/6] Fixed models for migrations (should also resolve test) --- ...r_contact_first_name_alter_contact_last_name_and_more.py | 6 ++---- src/registrar/models/transition_domain.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py b/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py index 28be99564..bc594138e 100644 --- a/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py +++ b/src/registrar/migrations/0071_alter_contact_first_name_alter_contact_last_name_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.10 on 2024-02-28 00:07 +# Generated by Django 4.2.10 on 2024-02-28 04:17 from django.db import migrations, models import phonenumber_field.modelfields @@ -849,9 +849,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name="transitiondomain", name="phone", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, help_text="Phone", max_length=128, null=True, region=None - ), + field=models.CharField(blank=True, help_text="Phone", null=True), ), migrations.AlterField( model_name="transitiondomain", diff --git a/src/registrar/models/transition_domain.py b/src/registrar/models/transition_domain.py index c8a952dd4..52e9791b3 100644 --- a/src/registrar/models/transition_domain.py +++ b/src/registrar/models/transition_domain.py @@ -108,7 +108,7 @@ class TransitionDomain(TimeStampedModel): blank=True, help_text="Email", ) - phone = PhoneNumberField( + phone = models.CharField( null=True, blank=True, help_text="Phone", From 50478c562136b9f7696763ef9db3b14d49c63fb6 Mon Sep 17 00:00:00 2001 From: CocoByte Date: Tue, 27 Feb 2024 23:45:19 -0700 Subject: [PATCH 6/6] linted --- src/registrar/models/transition_domain.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/registrar/models/transition_domain.py b/src/registrar/models/transition_domain.py index 52e9791b3..0c9c2ae66 100644 --- a/src/registrar/models/transition_domain.py +++ b/src/registrar/models/transition_domain.py @@ -1,6 +1,5 @@ from django.db import models from .utility.time_stamped_model import TimeStampedModel -from phonenumber_field.modelfields import PhoneNumberField # type: ignore class StatusChoices(models.TextChoices):