mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 01:27:03 +02:00
Model update and migration and subsequent variable and wording changes
This commit is contained in:
parent
370480572e
commit
696941aba7
11 changed files with 68 additions and 85 deletions
|
@ -233,7 +233,6 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
search_help_text = "Search by domain or submitter."
|
||||
|
||||
# Detail view
|
||||
# TODO-446: Add "about_your_organization" + remove "type_of_work" and "more_organization_information"
|
||||
fieldsets = [
|
||||
(None, {"fields": ["status", "investigator", "creator"]}),
|
||||
(
|
||||
|
@ -247,8 +246,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
"federal_agency",
|
||||
"federal_type",
|
||||
"is_election_board",
|
||||
"type_of_work",
|
||||
"more_organization_information",
|
||||
"about_your_organization",
|
||||
]
|
||||
},
|
||||
),
|
||||
|
@ -284,11 +282,9 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
|||
]
|
||||
|
||||
# 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 = [
|
||||
"creator",
|
||||
"type_of_work",
|
||||
"more_organization_information",
|
||||
"about_your_organization",
|
||||
"address_line1",
|
||||
"address_line2",
|
||||
"zipcode",
|
||||
|
|
|
@ -19,7 +19,6 @@ application_urls = [
|
|||
path("finished/", views.Finished.as_view(), name="finished"),
|
||||
]
|
||||
|
||||
# TODO-446: (Step.ABOUT_YOUR_ORGANIZATION, views.AboutYourOrganization),
|
||||
# dynamically generate the other application_urls
|
||||
for step, view in [
|
||||
# add/remove steps here
|
||||
|
@ -28,7 +27,7 @@ for step, view in [
|
|||
(Step.ORGANIZATION_FEDERAL, views.OrganizationFederal),
|
||||
(Step.ORGANIZATION_ELECTION, views.OrganizationElection),
|
||||
(Step.ORGANIZATION_CONTACT, views.OrganizationContact),
|
||||
(Step.TYPE_OF_WORK, views.TypeOfWork),
|
||||
(Step.ABOUT_YOUR_ORGANIZATION, views.AboutYourOrganization),
|
||||
(Step.AUTHORIZING_OFFICIAL, views.AuthorizingOfficial),
|
||||
(Step.CURRENT_SITES, views.CurrentSites),
|
||||
(Step.DOTGOV_DOMAIN, views.DotgovDomain),
|
||||
|
|
|
@ -309,10 +309,9 @@ class OrganizationContactForm(RegistrarForm):
|
|||
)
|
||||
return federal_agency
|
||||
|
||||
# TODO-446: Update name of form + variable naming + change label
|
||||
class TypeOfWorkForm(RegistrarForm):
|
||||
type_of_work = forms.CharField(
|
||||
label="Type of work",
|
||||
class AboutYourOrganizationForm(RegistrarForm):
|
||||
about_your_organization = forms.CharField(
|
||||
label="About your organization",
|
||||
widget=forms.Textarea(),
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
|
|
|
@ -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
|
||||
),
|
||||
),
|
||||
]
|
|
@ -378,27 +378,12 @@ class DomainApplication(TimeStampedModel):
|
|||
help_text="Urbanization (Puerto Rico only)",
|
||||
)
|
||||
|
||||
type_of_work = models.TextField(
|
||||
about_your_organization = models.TextField(
|
||||
null=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(
|
||||
"registrar.Contact",
|
||||
null=True,
|
||||
|
@ -662,8 +647,7 @@ class DomainApplication(TimeStampedModel):
|
|||
]
|
||||
return bool(user_choice and user_choice not in excluded)
|
||||
|
||||
# TODO-446: Rename to show_about_your_organization
|
||||
def show_type_of_work(self) -> bool:
|
||||
def show_about_your_organization(self) -> bool:
|
||||
"""Show this step if this is a special district or interstate."""
|
||||
user_choice = self.organization_type
|
||||
return user_choice in [
|
||||
|
|
|
@ -134,27 +134,12 @@ class DomainInformation(TimeStampedModel):
|
|||
verbose_name="Urbanization (Puerto Rico only)",
|
||||
)
|
||||
|
||||
type_of_work = models.TextField(
|
||||
about_your_organization = models.TextField(
|
||||
null=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(
|
||||
"registrar.Contact",
|
||||
null=True,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{% extends 'application_form.html' %}
|
||||
{% load field_helpers %}
|
||||
|
||||
<!-- TODO-446: Change name of file to be application_about_your_organization.html -->
|
||||
|
||||
{% block form_instructions %}
|
||||
<p>[For special districts, interstate governments]</p>
|
||||
<p>We’d 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>
|
||||
{% endblock %}
|
||||
|
||||
<!-- TODO-446: Change name form name -->
|
||||
{% block form_fields %}
|
||||
{% 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 %}
|
||||
{% endblock %}
|
|
@ -46,10 +46,8 @@
|
|||
Incomplete
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<!-- TODO-446: {% if step == Step.ABOUT_YOUR_ORGANIZATION %} -->
|
||||
{% if step == Step.TYPE_OF_WORK %}
|
||||
<p>{{ application.type_of_work|default:"Incomplete" }}</p>
|
||||
<p>{{ application.more_organization_information|default:"Incomplete" }}</p>
|
||||
{% if step == Step.ABOUT_YOUR_ORGANIZATION %}
|
||||
<p>{{ application.about_your_organization|default:"Incomplete" }}</p>
|
||||
{% endif %}
|
||||
{% if step == Step.AUTHORIZING_OFFICIAL %}
|
||||
{% if application.authorizing_official %}
|
||||
|
|
|
@ -68,21 +68,10 @@
|
|||
{% include "includes/summary_item.html" with title='Organization name and mailing address' value=domainapplication address='true' heading_level=heading_level %}
|
||||
{% endif %}
|
||||
|
||||
<!-- TODO-446:
|
||||
{% if domainapplication.about_your_organization %}
|
||||
{% 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 %}
|
||||
|
||||
{% 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 %}
|
||||
{% include "includes/summary_item.html" with title='Authorizing official' value=domainapplication.authorizing_official contact='true' heading_level=heading_level %}
|
||||
{% endif %}
|
||||
|
|
|
@ -241,14 +241,13 @@ class AuditedAdminMockData:
|
|||
is_policy_acknowledged: boolean = True,
|
||||
state_territory: str = "NY",
|
||||
zipcode: str = "10002",
|
||||
type_of_work: str = "e-Government",
|
||||
about_your_organization: str = "e-Government",
|
||||
anything_else: str = "There is more",
|
||||
authorizing_official: Contact = self.dummy_contact(item_name, "authorizing_official"),
|
||||
submitter: Contact = self.dummy_contact(item_name, "submitter"),
|
||||
creator: User = self.dummy_user(item_name, "creator"),
|
||||
}
|
||||
""" # noqa
|
||||
# TODO-446: Update type_of_work to about_your_organization
|
||||
common_args = dict(
|
||||
organization_type=org_type,
|
||||
federal_type=federal_type,
|
||||
|
@ -259,7 +258,7 @@ class AuditedAdminMockData:
|
|||
is_policy_acknowledged=True,
|
||||
state_territory="NY",
|
||||
zipcode="10002",
|
||||
type_of_work="e-Government",
|
||||
about_your_organization="e-Government",
|
||||
anything_else="There is more",
|
||||
authorizing_official=self.dummy_contact(item_name, "authorizing_official"),
|
||||
submitter=self.dummy_contact(item_name, "submitter"),
|
||||
|
@ -434,12 +433,11 @@ def create_user():
|
|||
password=p,
|
||||
)
|
||||
|
||||
# TODO-446: Update has_type_of_work to has_about_your_organization
|
||||
def completed_application(
|
||||
has_other_contacts=True,
|
||||
has_current_website=True,
|
||||
has_alternative_gov_domain=True,
|
||||
has_type_of_work=True,
|
||||
has_about_your_organization=True,
|
||||
has_anything_else=True,
|
||||
status=DomainApplication.STARTED,
|
||||
user=False,
|
||||
|
@ -487,9 +485,8 @@ def completed_application(
|
|||
creator=user,
|
||||
status=status,
|
||||
)
|
||||
# TODO-446: Update has_type_of_work to has_about_your_organization
|
||||
if has_type_of_work:
|
||||
domain_application_kwargs["type_of_work"] = "e-Government"
|
||||
if has_about_your_organization:
|
||||
domain_application_kwargs["about_your_organization"] = "e-Government"
|
||||
if has_anything_else:
|
||||
domain_application_kwargs["anything_else"] = "There is more"
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ from .utility import DomainApplicationPermissionView, ApplicationWizardPermissio
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO-446: ABOUT_YOUR_ORGANIZATION = "about_your_organization"
|
||||
class Step(StrEnum):
|
||||
"""
|
||||
Names for each page of the application wizard.
|
||||
|
@ -31,7 +30,7 @@ class Step(StrEnum):
|
|||
ORGANIZATION_FEDERAL = "organization_federal"
|
||||
ORGANIZATION_ELECTION = "organization_election"
|
||||
ORGANIZATION_CONTACT = "organization_contact"
|
||||
TYPE_OF_WORK = "type_of_work"
|
||||
ABOUT_YOUR_ORGANIZATION = "about_your_organization"
|
||||
AUTHORIZING_OFFICIAL = "authorizing_official"
|
||||
CURRENT_SITES = "current_sites"
|
||||
DOTGOV_DOMAIN = "dotgov_domain"
|
||||
|
@ -72,14 +71,13 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
|||
EDIT_URL_NAME = "edit-application"
|
||||
NEW_URL_NAME = "/register/"
|
||||
# We need to pass our human-readable step titles as context to the templates.
|
||||
# TODO-446: Step.ABOUT_YOUR_ORGANIZATION: _("About your organization"),
|
||||
TITLES = {
|
||||
Step.ORGANIZATION_TYPE: _("Type of organization"),
|
||||
Step.TRIBAL_GOVERNMENT: _("Tribal government"),
|
||||
Step.ORGANIZATION_FEDERAL: _("Federal government branch"),
|
||||
Step.ORGANIZATION_ELECTION: _("Election office"),
|
||||
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.CURRENT_SITES: _("Current website for your organization"),
|
||||
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
|
||||
# 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 = {
|
||||
Step.ORGANIZATION_FEDERAL: lambda w: w.from_model(
|
||||
"show_organization_federal", False
|
||||
|
@ -103,7 +100,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
|||
Step.ORGANIZATION_ELECTION: lambda w: w.from_model(
|
||||
"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(
|
||||
"show_no_other_contacts_rationale", False
|
||||
),
|
||||
|
@ -375,10 +372,10 @@ class OrganizationContact(ApplicationWizard):
|
|||
template_name = "application_org_contact.html"
|
||||
forms = [forms.OrganizationContactForm]
|
||||
|
||||
# TODO-446: Probs step 1 after migration? Update typeofwork naming to about_your_organization
|
||||
class TypeOfWork(ApplicationWizard):
|
||||
template_name = "application_type_of_work.html"
|
||||
forms = [forms.TypeOfWorkForm]
|
||||
|
||||
class AboutYourOrganization(ApplicationWizard):
|
||||
template_name = "application_about_your_organization.html"
|
||||
forms = [forms.AboutYourOrganizationForm]
|
||||
|
||||
|
||||
class AuthorizingOfficial(ApplicationWizard):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue