Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[litterbox] 2162: Delete Submitter field and Your contact information page #2693

Merged
merged 59 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f1c8f52
Remove refs to submitter in domain request
erinysong Aug 26, 2024
2f2b2fe
Remove submitter from models
erinysong Aug 26, 2024
2713e59
Remove submitter from model tests
erinysong Aug 26, 2024
ff9e73d
Continued test cleanup
erinysong Aug 27, 2024
11e44a3
Remove test_is_creator_complete test
erinysong Aug 27, 2024
9a83287
Remove test test_home_deletes_domain_request_and_orphans
erinysong Aug 27, 2024
d0b3dd7
Delete test_home_deletes_domain_request_and_orphans
erinysong Aug 27, 2024
2c43533
Remove submitter from deleting orphaned contacts
erinysong Aug 27, 2024
06ef54f
Delete outdated contact join tests
erinysong Aug 28, 2024
804d19f
remove submitter from orphan tests
erinysong Aug 28, 2024
29de97d
Revert deleted contact shared
erinysong Aug 28, 2024
5b3ae28
Restore variable in orphan tests
erinysong Aug 28, 2024
2fcad73
Update email status tests
erinysong Aug 28, 2024
a9ab882
Refactor email tests to deprecate submitter
erinysong Aug 28, 2024
a431b41
Fix linting
erinysong Aug 28, 2024
71d4435
Remove submitter refs in docs
erinysong Aug 28, 2024
2d52e02
Save progress
erinysong Aug 29, 2024
171be9a
Remove stragglign file
erinysong Aug 29, 2024
98a50fb
Test diagram update
erinysong Aug 29, 2024
dd99f8f
Revert Pipfile.lock
erinysong Aug 29, 2024
eac8363
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
erinysong Aug 29, 2024
f46cc14
Correct migrations
erinysong Aug 29, 2024
ce0befc
Update diagrams
therealslimhsiehdy Aug 29, 2024
bf00f20
remove unused INVESTIGATOR_NOT_SUBMITTER error code
erinysong Aug 29, 2024
fde8723
Revert requirements.txt
erinysong Aug 29, 2024
1bfc2df
Update migrations
erinysong Aug 29, 2024
f41c6b3
Revert settings.py
erinysong Aug 29, 2024
d879044
Delete submitter contacts
erinysong Aug 29, 2024
be54f8c
Add delete domain info migration
erinysong Aug 29, 2024
76e35db
Fix linting
erinysong Aug 29, 2024
d66c75a
Add migration changing submitted to cascade on delete
erinysong Aug 29, 2024
8db9ccd
Rename migrations
erinysong Aug 29, 2024
5d1f86f
Correct migration dependency
erinysong Aug 29, 2024
0171301
Correct migration dependencies
erinysong Aug 29, 2024
d0c598f
Correct cascade delete migration
erinysong Aug 29, 2024
bf83a15
Fix linting
erinysong Aug 29, 2024
6272dab
Fix cascade migration
erinysong Aug 29, 2024
c4c5ae8
Fix linting
erinysong Aug 29, 2024
cf86579
Add more conditions to cascade delete
erinysong Aug 30, 2024
17dd4dd
Add filter
erinysong Aug 30, 2024
79f020b
Fix linting
erinysong Aug 30, 2024
2acef3f
Convert submitter to null on delete
erinysong Sep 5, 2024
07d8017
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
erinysong Sep 5, 2024
f7fed00
Correct migration order
erinysong Sep 5, 2024
78476a9
Whitelist emails sent in test save models
erinysong Sep 5, 2024
138d05b
Merge branch 'main' into es/2162-delete-submitter-v2
therealslimhsiehdy Sep 6, 2024
72c955f
Fix spelling
therealslimhsiehdy Sep 6, 2024
fdc2435
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy Sep 9, 2024
a35d39e
Update migrations
therealslimhsiehdy Sep 9, 2024
96811ba
Fix linter
therealslimhsiehdy Sep 9, 2024
d0ae331
Address feedback
therealslimhsiehdy Sep 10, 2024
c909c2a
Update unit tests
therealslimhsiehdy Sep 10, 2024
f3ae6f8
Remove your contact information pointers and update tests
therealslimhsiehdy Sep 10, 2024
171b47c
Merge branch 'main' of https://github.com/cisagov/manage.get.gov into…
therealslimhsiehdy Sep 11, 2024
e5a0f94
Remove extraneous submitter
therealslimhsiehdy Sep 12, 2024
5c32a19
Merge branch 'main' into es/2162-delete-submitter-v2
therealslimhsiehdy Sep 12, 2024
1eac50b
Fix linter
therealslimhsiehdy Sep 12, 2024
5f3b1b1
Update migration numerics
therealslimhsiehdy Sep 12, 2024
289f7bd
Remove line from unit test - no submitter anymore for domain request
therealslimhsiehdy Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/architecture/diagrams/model_timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class DomainRequest {
creator (User)
investigator (User)
senior_official (Contact)
submitter (Contact)
other_contacts (Contacts)
approved_domain (Domain)
requested_domain (DraftDomain)
Expand Down Expand Up @@ -80,7 +79,7 @@ class Contact {
--
}

DomainRequest *-r-* Contact : senior_official, submitter, other_contacts
DomainRequest *-r-* Contact : senior_official, other_contacts

class DraftDomain {
Requested domain
Expand Down
70 changes: 59 additions & 11 deletions docs/architecture/diagrams/models_diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class "registrar.Contact <Registrar>" as registrar.Contact #d6f4e9 {
+ id (BigAutoField)
+ created_at (DateTimeField)
+ updated_at (DateTimeField)
~ user (OneToOneField)
+ first_name (CharField)
+ middle_name (CharField)
+ last_name (CharField)
Expand All @@ -47,7 +46,6 @@ class "registrar.Contact <Registrar>" as registrar.Contact #d6f4e9 {
+ phone (PhoneNumberField)
--
}
registrar.Contact -- registrar.User


class "registrar.Host <Registrar>" as registrar.Host #d6f4e9 {
Expand Down Expand Up @@ -143,6 +141,8 @@ class "registrar.FederalAgency <Registrar>" as registrar.FederalAgency #d6f4e9 {
+ updated_at (DateTimeField)
+ agency (CharField)
+ federal_type (CharField)
+ initials (CharField)
+ is_fceb (BooleanField)
--
}

Expand All @@ -159,6 +159,7 @@ class "registrar.DomainRequest <Registrar>" as registrar.DomainRequest #d6f4e9 {
+ action_needed_reason_email (TextField)
~ federal_agency (ForeignKey)
~ portfolio (ForeignKey)
~ sub_organization (ForeignKey)
~ creator (ForeignKey)
~ investigator (ForeignKey)
+ generic_org_type (CharField)
Expand All @@ -179,7 +180,6 @@ class "registrar.DomainRequest <Registrar>" as registrar.DomainRequest #d6f4e9 {
~ senior_official (ForeignKey)
~ approved_domain (OneToOneField)
~ requested_domain (OneToOneField)
~ submitter (ForeignKey)
+ purpose (TextField)
+ no_other_contacts_rationale (TextField)
+ anything_else (TextField)
Expand All @@ -198,12 +198,12 @@ class "registrar.DomainRequest <Registrar>" as registrar.DomainRequest #d6f4e9 {
}
registrar.DomainRequest -- registrar.FederalAgency
registrar.DomainRequest -- registrar.Portfolio
registrar.DomainRequest -- registrar.Suborganization
registrar.DomainRequest -- registrar.User
registrar.DomainRequest -- registrar.User
registrar.DomainRequest -- registrar.Contact
registrar.DomainRequest -- registrar.Domain
registrar.DomainRequest -- registrar.DraftDomain
registrar.DomainRequest -- registrar.Contact
registrar.DomainRequest *--* registrar.Website
registrar.DomainRequest *--* registrar.Website
registrar.DomainRequest *--* registrar.Contact
Expand All @@ -218,6 +218,7 @@ class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #
~ federal_agency (ForeignKey)
~ creator (ForeignKey)
~ portfolio (ForeignKey)
~ sub_organization (ForeignKey)
~ domain_request (OneToOneField)
+ generic_org_type (CharField)
+ organization_type (CharField)
Expand All @@ -236,7 +237,6 @@ class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #
+ about_your_organization (TextField)
~ senior_official (ForeignKey)
~ domain (OneToOneField)
~ submitter (ForeignKey)
+ purpose (TextField)
+ no_other_contacts_rationale (TextField)
+ anything_else (TextField)
Expand All @@ -253,10 +253,10 @@ class "registrar.DomainInformation <Registrar>" as registrar.DomainInformation #
registrar.DomainInformation -- registrar.FederalAgency
registrar.DomainInformation -- registrar.User
registrar.DomainInformation -- registrar.Portfolio
registrar.DomainInformation -- registrar.Suborganization
registrar.DomainInformation -- registrar.DomainRequest
registrar.DomainInformation -- registrar.Contact
registrar.DomainInformation -- registrar.Domain
registrar.DomainInformation -- registrar.Contact
registrar.DomainInformation *--* registrar.Contact


Expand Down Expand Up @@ -285,6 +285,38 @@ class "registrar.DomainInvitation <Registrar>" as registrar.DomainInvitation #d6
registrar.DomainInvitation -- registrar.Domain


class "registrar.UserPortfolioPermission <Registrar>" as registrar.UserPortfolioPermission #d6f4e9 {
user portfolio permission
--
+ id (BigAutoField)
+ created_at (DateTimeField)
+ updated_at (DateTimeField)
~ user (ForeignKey)
~ portfolio (ForeignKey)
+ roles (ArrayField)
+ additional_permissions (ArrayField)
--
}
registrar.UserPortfolioPermission -- registrar.User
registrar.UserPortfolioPermission -- registrar.Portfolio


class "registrar.PortfolioInvitation <Registrar>" as registrar.PortfolioInvitation #d6f4e9 {
portfolio invitation
--
+ id (BigAutoField)
+ created_at (DateTimeField)
+ updated_at (DateTimeField)
+ email (EmailField)
~ portfolio (ForeignKey)
+ portfolio_roles (ArrayField)
+ portfolio_additional_permissions (ArrayField)
+ status (FSMField)
--
}
registrar.PortfolioInvitation -- registrar.Portfolio


class "registrar.TransitionDomain <Registrar>" as registrar.TransitionDomain #d6f4e9 {
transition domain
--
Expand Down Expand Up @@ -409,10 +441,11 @@ class "registrar.Portfolio <Registrar>" as registrar.Portfolio #d6f4e9 {
+ created_at (DateTimeField)
+ updated_at (DateTimeField)
~ creator (ForeignKey)
+ organization_name (CharField)
+ organization_type (CharField)
+ notes (TextField)
~ federal_agency (ForeignKey)
+ organization_type (CharField)
+ organization_name (CharField)
~ senior_official (ForeignKey)
+ address_line1 (CharField)
+ address_line2 (CharField)
+ city (CharField)
Expand All @@ -424,6 +457,7 @@ class "registrar.Portfolio <Registrar>" as registrar.Portfolio #d6f4e9 {
}
registrar.Portfolio -- registrar.User
registrar.Portfolio -- registrar.FederalAgency
registrar.Portfolio -- registrar.SeniorOfficial


class "registrar.DomainGroup <Registrar>" as registrar.DomainGroup #d6f4e9 {
Expand Down Expand Up @@ -454,7 +488,21 @@ class "registrar.Suborganization <Registrar>" as registrar.Suborganization #d6f4
registrar.Suborganization -- registrar.Portfolio


@enduml
```
class "registrar.SeniorOfficial <Registrar>" as registrar.SeniorOfficial #d6f4e9 {
senior official
--
+ id (BigAutoField)
+ created_at (DateTimeField)
+ updated_at (DateTimeField)
+ first_name (CharField)
+ last_name (CharField)
+ title (CharField)
+ phone (PhoneNumberField)
+ email (EmailField)
~ federal_agency (ForeignKey)
--
}
registrar.SeniorOfficial -- registrar.FederalAgency

</details>

@enduml
2 changes: 1 addition & 1 deletion docs/architecture/diagrams/models_diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/developer/generating-emails-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Starting Location: Home page
- Workflow: (Domain requests Table) Manage domain
- Workflow Step: Click "Manage" -> Click "Withdraw request" -> (confirmation prompt) -> Click "Withdraw request" (inside prompt)
- Notes: You can also do this through Django Admin by switching a domain of status "submitted" to "withdrawn", but you need to be the submitter (email listed on Your Contact Information).
- Notes: You can also do this through Django Admin by switching a domain of status "submitted" to "withdrawn", but you need to be the creator.
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/domain_request_withdrawn.txt)

### Domain Request Withdrawn Subject
Expand All @@ -25,7 +25,7 @@
- Starting Location: Django Admin
- Workflow: Analyst Admin
- Workflow Step: Click "domain requests" -> Click a domain request in a status of "submitted", "In review", "rejected", or "ineligible" -> Click status dropdown -> (select "approved") -> click "Save"
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create a domain request, then set the status to "approved". This will send you an email.
- Notes: Note that this will send an email to the creator. To test this with your own email, you need to create a domain request, then set the status to "approved". This will send you an email.
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/status_change_approved.txt)

### Status Change Approved Subject
Expand All @@ -36,7 +36,7 @@
- Starting Location: Django Admin
- Workflow: Analyst Admin
- Workflow Step: Click "domain requests" -> Click a domain request in a status of "In review", or "approved" -> Click status dropdown -> (select "rejected") -> click "Save"
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information). To test this with your own email, you need to create a domain request, then set the status to "in review" (and click save). Then, go back to the same application and set the status to "rejected". This will send you an email.
- Notes: Note that this will send an email to the creator. To test this with your own email, you need to create a domain request, then set the status to "in review" (and click save). Then, go back to the same application and set the status to "rejected". This will send you an email.
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/status_change_rejected.txt)

### Status Change Rejected Subject
Expand All @@ -47,7 +47,7 @@
- Starting Location: Home Page
- Workflow: Start domain request
- Workflow Step: Click "Start a new domain request" -> (fill out the form) -> On the last step ("Review and submit your domain request "), click "Submit your domain request"
- Notes: Note that this will send an email to the submitter (email listed on Your Contact Information)
- Notes: Note that this will send an email to the creator.
- [Email Content](https://github.com/cisagov/manage.get.gov/blob/main/src/registrar/templates/emails/submission_confirmation.txt)

### Submission Confirmation Subject
Expand Down
29 changes: 7 additions & 22 deletions src/registrar/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ class AdminSortFields:
sort_mapping = {
# == Contact == #
"other_contacts": (Contact, _name_sort),
"submitter": (Contact, _name_sort),
# == Senior Official == #
"senior_official": (SeniorOfficial, _name_sort),
# == User == #
Expand Down Expand Up @@ -1439,13 +1438,9 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
"domain",
"generic_org_type",
"created_at",
"submitter",
]

orderable_fk_fields = [
("domain", "name"),
("submitter", ["first_name", "last_name"]),
]
orderable_fk_fields = [("domain", "name")]

# Filters
list_filter = ["generic_org_type"]
Expand All @@ -1457,7 +1452,7 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
search_help_text = "Search by domain."

fieldsets = [
(None, {"fields": ["portfolio", "sub_organization", "creator", "submitter", "domain_request", "notes"]}),
(None, {"fields": ["portfolio", "sub_organization", "creator", "domain_request", "notes"]}),
(".gov domain", {"fields": ["domain"]}),
("Contacts", {"fields": ["senior_official", "other_contacts", "no_other_contacts_rationale"]}),
("Background info", {"fields": ["anything_else"]}),
Expand Down Expand Up @@ -1521,7 +1516,6 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
"more_organization_information",
"domain",
"domain_request",
"submitter",
"no_other_contacts_rationale",
"anything_else",
"is_policy_acknowledged",
Expand All @@ -1536,7 +1530,6 @@ class DomainInformationAdmin(ListHeaderAdmin, ImportExportModelAdmin):
"domain_request",
"senior_official",
"domain",
"submitter",
"portfolio",
"sub_organization",
]
Expand Down Expand Up @@ -1709,13 +1702,11 @@ def queryset(self, request, queryset):
"custom_election_board",
"city",
"state_territory",
"submitter",
"investigator",
]

orderable_fk_fields = [
("requested_domain", "name"),
("submitter", ["first_name", "last_name"]),
("investigator", ["first_name", "last_name"]),
]

Expand Down Expand Up @@ -1745,11 +1736,11 @@ def status_history(self, obj):
# Search
search_fields = [
"requested_domain__name",
"submitter__email",
"submitter__first_name",
"submitter__last_name",
"creator__email",
"creator__first_name",
"creator__last_name",
]
search_help_text = "Search by domain or submitter."
search_help_text = "Search by domain or creator."

fieldsets = [
(
Expand All @@ -1765,7 +1756,6 @@ def status_history(self, obj):
"action_needed_reason_email",
"investigator",
"creator",
"submitter",
"approved_domain",
"notes",
]
Expand Down Expand Up @@ -1853,7 +1843,6 @@ def status_history(self, obj):
"approved_domain",
"alternative_domains",
"purpose",
"submitter",
"no_other_contacts_rationale",
"anything_else",
"is_policy_acknowledged",
Expand All @@ -1864,7 +1853,6 @@ def status_history(self, obj):
autocomplete_fields = [
"approved_domain",
"requested_domain",
"submitter",
"creator",
"senior_official",
"investigator",
Expand Down Expand Up @@ -2201,10 +2189,7 @@ def _get_action_needed_reason_default_email(self, domain_request, action_needed_
if not action_needed_reason or action_needed_reason == DomainRequest.ActionNeededReasons.OTHER:
return None

if flag_is_active(None, "profile_feature"): # type: ignore
recipient = domain_request.creator
else:
recipient = domain_request.submitter
recipient = domain_request.creator

# Return the context of the rendered views
context = {"domain_request": domain_request, "recipient": recipient}
Expand Down
6 changes: 0 additions & 6 deletions src/registrar/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
(Step.CURRENT_SITES, views.CurrentSites),
(Step.DOTGOV_DOMAIN, views.DotgovDomain),
(Step.PURPOSE, views.Purpose),
(Step.YOUR_CONTACT, views.YourContact),
(Step.OTHER_CONTACTS, views.OtherContacts),
(Step.ADDITIONAL_DETAILS, views.AdditionalDetails),
(Step.REQUIREMENTS, views.Requirements),
Expand Down Expand Up @@ -206,11 +205,6 @@
views.DomainDsDataView.as_view(),
name="domain-dns-dnssec-dsdata",
),
path(
"domain/<int:pk>/your-contact-information",
views.DomainYourContactInformationView.as_view(),
name="domain-your-contact-information",
),
path(
"domain/<int:pk>/org-name-address",
views.DomainOrgNameAddressView.as_view(),
Expand Down
7 changes: 0 additions & 7 deletions src/registrar/fixtures_domain_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class DomainRequestFixture:
# "anything_else": None,
# "is_policy_acknowledged": None,
# "senior_official": None,
# "submitter": None,
# "other_contacts": [],
# "current_websites": [],
# "alternative_domains": [],
Expand Down Expand Up @@ -123,12 +122,6 @@ def _set_foreign_key_fields(cls, da: DomainRequest, app: dict, user: User):
else:
da.senior_official = Contact.objects.create(**cls.fake_contact())

if not da.submitter:
if "submitter" in app and app["submitter"] is not None:
da.submitter, _ = Contact.objects.get_or_create(**app["submitter"])
else:
da.submitter = Contact.objects.create(**cls.fake_contact())

if not da.requested_domain:
if "requested_domain" in app and app["requested_domain"] is not None:
da.requested_domain, _ = DraftDomain.objects.get_or_create(name=app["requested_domain"])
Expand Down
Loading
Loading