Model update and migration and subsequent variable and wording changes

This commit is contained in:
Rebecca Hsieh 2023-09-06 15:58:57 -07:00
parent 370480572e
commit 696941aba7
No known key found for this signature in database
GPG key ID: 644527A2F375A379
11 changed files with 68 additions and 85 deletions

View file

@ -233,7 +233,6 @@ class DomainApplicationAdmin(ListHeaderAdmin):
search_help_text = "Search by domain or submitter." search_help_text = "Search by domain or submitter."
# Detail view # Detail view
# TODO-446: Add "about_your_organization" + remove "type_of_work" and "more_organization_information"
fieldsets = [ fieldsets = [
(None, {"fields": ["status", "investigator", "creator"]}), (None, {"fields": ["status", "investigator", "creator"]}),
( (
@ -247,8 +246,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
"federal_agency", "federal_agency",
"federal_type", "federal_type",
"is_election_board", "is_election_board",
"type_of_work", "about_your_organization",
"more_organization_information",
] ]
}, },
), ),
@ -284,11 +282,9 @@ class DomainApplicationAdmin(ListHeaderAdmin):
] ]
# Read only that we'll leverage for CISA Analysts # Read only that we'll leverage for CISA Analysts
# TODO-446: Add "about_your_organization" + remove "type_of_work" and "more_organization_information"
analyst_readonly_fields = [ analyst_readonly_fields = [
"creator", "creator",
"type_of_work", "about_your_organization",
"more_organization_information",
"address_line1", "address_line1",
"address_line2", "address_line2",
"zipcode", "zipcode",

View file

@ -19,7 +19,6 @@ application_urls = [
path("finished/", views.Finished.as_view(), name="finished"), path("finished/", views.Finished.as_view(), name="finished"),
] ]
# TODO-446: (Step.ABOUT_YOUR_ORGANIZATION, views.AboutYourOrganization),
# dynamically generate the other application_urls # dynamically generate the other application_urls
for step, view in [ for step, view in [
# add/remove steps here # add/remove steps here
@ -28,7 +27,7 @@ for step, view in [
(Step.ORGANIZATION_FEDERAL, views.OrganizationFederal), (Step.ORGANIZATION_FEDERAL, views.OrganizationFederal),
(Step.ORGANIZATION_ELECTION, views.OrganizationElection), (Step.ORGANIZATION_ELECTION, views.OrganizationElection),
(Step.ORGANIZATION_CONTACT, views.OrganizationContact), (Step.ORGANIZATION_CONTACT, views.OrganizationContact),
(Step.TYPE_OF_WORK, views.TypeOfWork), (Step.ABOUT_YOUR_ORGANIZATION, views.AboutYourOrganization),
(Step.AUTHORIZING_OFFICIAL, views.AuthorizingOfficial), (Step.AUTHORIZING_OFFICIAL, views.AuthorizingOfficial),
(Step.CURRENT_SITES, views.CurrentSites), (Step.CURRENT_SITES, views.CurrentSites),
(Step.DOTGOV_DOMAIN, views.DotgovDomain), (Step.DOTGOV_DOMAIN, views.DotgovDomain),

View file

@ -309,10 +309,9 @@ class OrganizationContactForm(RegistrarForm):
) )
return federal_agency return federal_agency
# TODO-446: Update name of form + variable naming + change label class AboutYourOrganizationForm(RegistrarForm):
class TypeOfWorkForm(RegistrarForm): about_your_organization = forms.CharField(
type_of_work = forms.CharField( label="About your organization",
label="Type of work",
widget=forms.Textarea(), widget=forms.Textarea(),
validators=[ validators=[
MaxLengthValidator( MaxLengthValidator(

View file

@ -0,0 +1,42 @@
# Generated by Django 4.2.1 on 2023-09-06 16:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registrar", "0030_alter_user_status"),
]
operations = [
migrations.RemoveField(
model_name="domainapplication",
name="more_organization_information",
),
migrations.RemoveField(
model_name="domainapplication",
name="type_of_work",
),
migrations.RemoveField(
model_name="domaininformation",
name="more_organization_information",
),
migrations.RemoveField(
model_name="domaininformation",
name="type_of_work",
),
migrations.AddField(
model_name="domainapplication",
name="about_your_organization",
field=models.TextField(
blank=True, help_text="Information about your organization", null=True
),
),
migrations.AddField(
model_name="domaininformation",
name="about_your_organization",
field=models.TextField(
blank=True, help_text="Information about your organization", null=True
),
),
]

View file

@ -378,27 +378,12 @@ class DomainApplication(TimeStampedModel):
help_text="Urbanization (Puerto Rico only)", help_text="Urbanization (Puerto Rico only)",
) )
type_of_work = models.TextField( about_your_organization = models.TextField(
null=True, null=True,
blank=True, blank=True,
help_text="Type of work of the organization", help_text="Information about your organization",
) )
# TODO-446:
# about_your_organization = models.TextField(
# null=True,
# blank=True,
# help_text="Information about your organization",
# )
more_organization_information = models.TextField(
null=True,
blank=True,
help_text="More information about your organization",
)
# TODO-446: Remove above bc we don't need this textbox anymore
authorizing_official = models.ForeignKey( authorizing_official = models.ForeignKey(
"registrar.Contact", "registrar.Contact",
null=True, null=True,
@ -662,8 +647,7 @@ class DomainApplication(TimeStampedModel):
] ]
return bool(user_choice and user_choice not in excluded) return bool(user_choice and user_choice not in excluded)
# TODO-446: Rename to show_about_your_organization def show_about_your_organization(self) -> bool:
def show_type_of_work(self) -> bool:
"""Show this step if this is a special district or interstate.""" """Show this step if this is a special district or interstate."""
user_choice = self.organization_type user_choice = self.organization_type
return user_choice in [ return user_choice in [

View file

@ -134,27 +134,12 @@ class DomainInformation(TimeStampedModel):
verbose_name="Urbanization (Puerto Rico only)", verbose_name="Urbanization (Puerto Rico only)",
) )
type_of_work = models.TextField( about_your_organization = models.TextField(
null=True, null=True,
blank=True, blank=True,
help_text="Type of work of the organization", help_text="Information about your organization",
) )
# TODO-446:
# about_your_organization = models.TextField(
# null=True,
# blank=True,
# help_text="Information about your organization",
# )
more_organization_information = models.TextField(
null=True,
blank=True,
help_text="Further information about the government organization",
)
# TODO-446: Remove above bc we don't need this textbox anymore
authorizing_official = models.ForeignKey( authorizing_official = models.ForeignKey(
"registrar.Contact", "registrar.Contact",
null=True, null=True,

View file

@ -1,8 +1,6 @@
{% extends 'application_form.html' %} {% extends 'application_form.html' %}
{% load field_helpers %} {% load field_helpers %}
<!-- TODO-446: Change name of file to be application_about_your_organization.html -->
{% block form_instructions %} {% block form_instructions %}
<p>[For special districts, interstate governments]</p> <p>[For special districts, interstate governments]</p>
<p>Wed like to know more about your organization. Include the following in your response: </p> <p>Wed like to know more about your organization. Include the following in your response: </p>
@ -19,9 +17,8 @@
<p class="text-semibold"><abbr class="usa-hint usa-hint--required" title="required">*</abbr>This question is required.</p> <p class="text-semibold"><abbr class="usa-hint usa-hint--required" title="required">*</abbr>This question is required.</p>
{% endblock %} {% endblock %}
<!-- TODO-446: Change name form name -->
{% block form_fields %} {% block form_fields %}
{% with attr_maxlength=1000 add_label_class="usa-sr-only" %} {% with attr_maxlength=1000 add_label_class="usa-sr-only" %}
{% input_with_errors forms.0.type_of_work %} {% input_with_errors forms.0.about_your_organization %}
{% endwith %} {% endwith %}
{% endblock %} {% endblock %}

View file

@ -46,10 +46,8 @@
Incomplete Incomplete
{% endif %} {% endif %}
{% endif %} {% endif %}
<!-- TODO-446: {% if step == Step.ABOUT_YOUR_ORGANIZATION %} --> {% if step == Step.ABOUT_YOUR_ORGANIZATION %}
{% if step == Step.TYPE_OF_WORK %} <p>{{ application.about_your_organization|default:"Incomplete" }}</p>
<p>{{ application.type_of_work|default:"Incomplete" }}</p>
<p>{{ application.more_organization_information|default:"Incomplete" }}</p>
{% endif %} {% endif %}
{% if step == Step.AUTHORIZING_OFFICIAL %} {% if step == Step.AUTHORIZING_OFFICIAL %}
{% if application.authorizing_official %} {% if application.authorizing_official %}

View file

@ -68,21 +68,10 @@
{% include "includes/summary_item.html" with title='Organization name and mailing address' value=domainapplication address='true' heading_level=heading_level %} {% include "includes/summary_item.html" with title='Organization name and mailing address' value=domainapplication address='true' heading_level=heading_level %}
{% endif %} {% endif %}
<!-- TODO-446:
{% if domainapplication.about_your_organization %} {% if domainapplication.about_your_organization %}
{% include "includes/summary_item.html" with title='About your organization' value=domainapplication.about_your_organization heading_level=heading_level %} {% include "includes/summary_item.html" with title='About your organization' value=domainapplication.about_your_organization heading_level=heading_level %}
{% endif %} -->
{% if domainapplication.type_of_work %}
{% include "includes/summary_item.html" with title='Type of work' value=domainapplication.type_of_work heading_level=heading_level %}
{% endif %} {% endif %}
{% if domainapplication.more_organization_information %}
{% include "includes/summary_item.html" with title='More information about your organization' value=domainapplication.more_organization_information heading_level=heading_level %}
{% endif %}
<!-- TODO-446: Remove above because won't need the textbox anymore -->
{% if domainapplication.authorizing_official %} {% if domainapplication.authorizing_official %}
{% include "includes/summary_item.html" with title='Authorizing official' value=domainapplication.authorizing_official contact='true' heading_level=heading_level %} {% include "includes/summary_item.html" with title='Authorizing official' value=domainapplication.authorizing_official contact='true' heading_level=heading_level %}
{% endif %} {% endif %}

View file

@ -241,14 +241,13 @@ class AuditedAdminMockData:
is_policy_acknowledged: boolean = True, is_policy_acknowledged: boolean = True,
state_territory: str = "NY", state_territory: str = "NY",
zipcode: str = "10002", zipcode: str = "10002",
type_of_work: str = "e-Government", about_your_organization: str = "e-Government",
anything_else: str = "There is more", anything_else: str = "There is more",
authorizing_official: Contact = self.dummy_contact(item_name, "authorizing_official"), authorizing_official: Contact = self.dummy_contact(item_name, "authorizing_official"),
submitter: Contact = self.dummy_contact(item_name, "submitter"), submitter: Contact = self.dummy_contact(item_name, "submitter"),
creator: User = self.dummy_user(item_name, "creator"), creator: User = self.dummy_user(item_name, "creator"),
} }
""" # noqa """ # noqa
# TODO-446: Update type_of_work to about_your_organization
common_args = dict( common_args = dict(
organization_type=org_type, organization_type=org_type,
federal_type=federal_type, federal_type=federal_type,
@ -259,7 +258,7 @@ class AuditedAdminMockData:
is_policy_acknowledged=True, is_policy_acknowledged=True,
state_territory="NY", state_territory="NY",
zipcode="10002", zipcode="10002",
type_of_work="e-Government", about_your_organization="e-Government",
anything_else="There is more", anything_else="There is more",
authorizing_official=self.dummy_contact(item_name, "authorizing_official"), authorizing_official=self.dummy_contact(item_name, "authorizing_official"),
submitter=self.dummy_contact(item_name, "submitter"), submitter=self.dummy_contact(item_name, "submitter"),
@ -434,12 +433,11 @@ def create_user():
password=p, password=p,
) )
# TODO-446: Update has_type_of_work to has_about_your_organization
def completed_application( def completed_application(
has_other_contacts=True, has_other_contacts=True,
has_current_website=True, has_current_website=True,
has_alternative_gov_domain=True, has_alternative_gov_domain=True,
has_type_of_work=True, has_about_your_organization=True,
has_anything_else=True, has_anything_else=True,
status=DomainApplication.STARTED, status=DomainApplication.STARTED,
user=False, user=False,
@ -487,9 +485,8 @@ def completed_application(
creator=user, creator=user,
status=status, status=status,
) )
# TODO-446: Update has_type_of_work to has_about_your_organization if has_about_your_organization:
if has_type_of_work: domain_application_kwargs["about_your_organization"] = "e-Government"
domain_application_kwargs["type_of_work"] = "e-Government"
if has_anything_else: if has_anything_else:
domain_application_kwargs["anything_else"] = "There is more" domain_application_kwargs["anything_else"] = "There is more"

View file

@ -17,7 +17,6 @@ from .utility import DomainApplicationPermissionView, ApplicationWizardPermissio
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# TODO-446: ABOUT_YOUR_ORGANIZATION = "about_your_organization"
class Step(StrEnum): class Step(StrEnum):
""" """
Names for each page of the application wizard. Names for each page of the application wizard.
@ -31,7 +30,7 @@ class Step(StrEnum):
ORGANIZATION_FEDERAL = "organization_federal" ORGANIZATION_FEDERAL = "organization_federal"
ORGANIZATION_ELECTION = "organization_election" ORGANIZATION_ELECTION = "organization_election"
ORGANIZATION_CONTACT = "organization_contact" ORGANIZATION_CONTACT = "organization_contact"
TYPE_OF_WORK = "type_of_work" ABOUT_YOUR_ORGANIZATION = "about_your_organization"
AUTHORIZING_OFFICIAL = "authorizing_official" AUTHORIZING_OFFICIAL = "authorizing_official"
CURRENT_SITES = "current_sites" CURRENT_SITES = "current_sites"
DOTGOV_DOMAIN = "dotgov_domain" DOTGOV_DOMAIN = "dotgov_domain"
@ -72,14 +71,13 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
EDIT_URL_NAME = "edit-application" EDIT_URL_NAME = "edit-application"
NEW_URL_NAME = "/register/" NEW_URL_NAME = "/register/"
# We need to pass our human-readable step titles as context to the templates. # We need to pass our human-readable step titles as context to the templates.
# TODO-446: Step.ABOUT_YOUR_ORGANIZATION: _("About your organization"),
TITLES = { TITLES = {
Step.ORGANIZATION_TYPE: _("Type of organization"), Step.ORGANIZATION_TYPE: _("Type of organization"),
Step.TRIBAL_GOVERNMENT: _("Tribal government"), Step.TRIBAL_GOVERNMENT: _("Tribal government"),
Step.ORGANIZATION_FEDERAL: _("Federal government branch"), Step.ORGANIZATION_FEDERAL: _("Federal government branch"),
Step.ORGANIZATION_ELECTION: _("Election office"), Step.ORGANIZATION_ELECTION: _("Election office"),
Step.ORGANIZATION_CONTACT: _("Organization name and mailing address"), Step.ORGANIZATION_CONTACT: _("Organization name and mailing address"),
Step.TYPE_OF_WORK: _("Type of work"), Step.ABOUT_YOUR_ORGANIZATION: _("About your organization"),
Step.AUTHORIZING_OFFICIAL: _("Authorizing official"), Step.AUTHORIZING_OFFICIAL: _("Authorizing official"),
Step.CURRENT_SITES: _("Current website for your organization"), Step.CURRENT_SITES: _("Current website for your organization"),
Step.DOTGOV_DOMAIN: _(".gov domain"), Step.DOTGOV_DOMAIN: _(".gov domain"),
@ -94,7 +92,6 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
# We can use a dictionary with step names and callables that return booleans # We can use a dictionary with step names and callables that return booleans
# to show or hide particular steps based on the state of the process. # to show or hide particular steps based on the state of the process.
# TODO-446: Step.ABOUT_YOUR_ORGANIZATION: lambda w: w.from_model("show_about_your_organization", False),
WIZARD_CONDITIONS = { WIZARD_CONDITIONS = {
Step.ORGANIZATION_FEDERAL: lambda w: w.from_model( Step.ORGANIZATION_FEDERAL: lambda w: w.from_model(
"show_organization_federal", False "show_organization_federal", False
@ -103,7 +100,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
Step.ORGANIZATION_ELECTION: lambda w: w.from_model( Step.ORGANIZATION_ELECTION: lambda w: w.from_model(
"show_organization_election", False "show_organization_election", False
), ),
Step.TYPE_OF_WORK: lambda w: w.from_model("show_type_of_work", False), Step.ABOUT_YOUR_ORGANIZATION: lambda w: w.from_model("show_about_your_organization", False),
Step.NO_OTHER_CONTACTS: lambda w: w.from_model( Step.NO_OTHER_CONTACTS: lambda w: w.from_model(
"show_no_other_contacts_rationale", False "show_no_other_contacts_rationale", False
), ),
@ -375,10 +372,10 @@ class OrganizationContact(ApplicationWizard):
template_name = "application_org_contact.html" template_name = "application_org_contact.html"
forms = [forms.OrganizationContactForm] forms = [forms.OrganizationContactForm]
# TODO-446: Probs step 1 after migration? Update typeofwork naming to about_your_organization
class TypeOfWork(ApplicationWizard): class AboutYourOrganization(ApplicationWizard):
template_name = "application_type_of_work.html" template_name = "application_about_your_organization.html"
forms = [forms.TypeOfWorkForm] forms = [forms.AboutYourOrganizationForm]
class AuthorizingOfficial(ApplicationWizard): class AuthorizingOfficial(ApplicationWizard):