From 3ffe3002cb625adb826d0a84094517a8e295df01 Mon Sep 17 00:00:00 2001 From: Alysia Broddrick Date: Tue, 9 Jan 2024 12:01:08 -0800 Subject: [PATCH 1/5] removed bl infra --- .github/workflows/migrate.yaml | 1 - .github/workflows/reset-db.yaml | 1 - ops/manifests/manifest-bl.yaml | 32 -------------------------------- src/registrar/config/settings.py | 1 - 4 files changed, 35 deletions(-) delete mode 100644 ops/manifests/manifest-bl.yaml diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index 8523af013..2033ee51c 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -26,7 +26,6 @@ on: - rb - ko - ab - - bl - rjm - dk diff --git a/.github/workflows/reset-db.yaml b/.github/workflows/reset-db.yaml index 3848a33bd..f8730c865 100644 --- a/.github/workflows/reset-db.yaml +++ b/.github/workflows/reset-db.yaml @@ -26,7 +26,6 @@ on: - rb - ko - ab - - bl - rjm - dk diff --git a/ops/manifests/manifest-bl.yaml b/ops/manifests/manifest-bl.yaml deleted file mode 100644 index 59529278b..000000000 --- a/ops/manifests/manifest-bl.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -applications: -- name: getgov-bl - buildpacks: - - python_buildpack - path: ../../src - instances: 1 - memory: 512M - stack: cflinuxfs4 - timeout: 180 - command: ./run.sh - health-check-type: http - health-check-http-endpoint: /health - health-check-invocation-timeout: 40 - env: - # Send stdout and stderr straight to the terminal without buffering - PYTHONUNBUFFERED: yup - # Tell Django where to find its configuration - DJANGO_SETTINGS_MODULE: registrar.config.settings - # Tell Django where it is being hosted - DJANGO_BASE_URL: https://getgov-bl.app.cloud.gov - # Tell Django how much stuff to log - DJANGO_LOG_LEVEL: INFO - # default public site location - GETGOV_PUBLIC_SITE_URL: https://beta.get.gov - # Flag to disable/enable features in prod environments - IS_PRODUCTION: False - routes: - - route: getgov-bl.app.cloud.gov - services: - - getgov-credentials - - getgov-bl-database diff --git a/src/registrar/config/settings.py b/src/registrar/config/settings.py index 2de7e6eb2..f037d4901 100644 --- a/src/registrar/config/settings.py +++ b/src/registrar/config/settings.py @@ -660,7 +660,6 @@ ALLOWED_HOSTS = [ "getgov-rb.app.cloud.gov", "getgov-ko.app.cloud.gov", "getgov-ab.app.cloud.gov", - "getgov-bl.app.cloud.gov", "getgov-rjm.app.cloud.gov", "getgov-dk.app.cloud.gov", "manage.get.gov", From 52fff3b82c65dd5d7863fcf9bc6ef11eb2bce82f Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:58:43 -0700 Subject: [PATCH 2/5] Add verbose names --- src/registrar/models/domain_application.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/registrar/models/domain_application.py b/src/registrar/models/domain_application.py index 196449bfa..30def9cfc 100644 --- a/src/registrar/models/domain_application.py +++ b/src/registrar/models/domain_application.py @@ -431,11 +431,13 @@ class DomainApplication(TimeStampedModel): null=True, blank=True, help_text="Street address", + verbose_name="Address line 1", ) address_line2 = models.TextField( null=True, blank=True, help_text="Street address line 2 (optional)", + verbose_name="Address line 2", ) city = models.TextField( null=True, From 5d97893b92eda69cb618a87328ab05c3cb26ff71 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:01:19 -0700 Subject: [PATCH 3/5] Add migration --- ...omainapplication_address_line1_and_more.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py diff --git a/src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py b/src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py new file mode 100644 index 000000000..99ffac7aa --- /dev/null +++ b/src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.7 on 2024-01-23 22:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("registrar", "0062_alter_host_name"), + ] + + operations = [ + migrations.AlterField( + model_name="domainapplication", + name="address_line1", + field=models.TextField(blank=True, help_text="Street address", null=True, verbose_name="Address line 1"), + ), + migrations.AlterField( + model_name="domainapplication", + name="address_line2", + field=models.TextField( + blank=True, help_text="Street address line 2 (optional)", null=True, verbose_name="Address line 2" + ), + ), + ] From e9160e67f8d1e510a1c20db6d373ffb829666a9b Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Wed, 24 Jan 2024 13:23:56 -0500 Subject: [PATCH 4/5] Change requester to requestor in code --- .../templates/emails/domain_invitation.txt | 2 +- src/registrar/tests/test_views.py | 12 ++++----- src/registrar/views/domain.py | 26 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/registrar/templates/emails/domain_invitation.txt b/src/registrar/templates/emails/domain_invitation.txt index b9e4ba853..8896bd85f 100644 --- a/src/registrar/templates/emails/domain_invitation.txt +++ b/src/registrar/templates/emails/domain_invitation.txt @@ -1,7 +1,7 @@ {% autoescape off %}{# In a text file, we don't want to have HTML entities escaped #} Hi. -{{ requester_email }} has added you as a manager on {{ domain.name }}. +{{ requestor_email }} has added you as a manager on {{ domain.name }}. You can manage this domain on the .gov registrar . diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 60ffab416..a6cc3f0f8 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -2590,7 +2590,7 @@ class TestDomainManagers(TestDomainOverview): ) @boto3_mocking.patching - def test_domain_invitation_email_has_email_as_requester_non_existent(self): + def test_domain_invitation_email_has_email_as_requestor_non_existent(self): """Inviting a non existent user sends them an email, with email as the name.""" # make sure there is no user with this email email_address = "mayor@igorville.gov" @@ -2623,13 +2623,13 @@ class TestDomainManagers(TestDomainOverview): email_content = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"] self.assertIn("info@example.com", email_content) - # Check that the requesters first/last name do not exist + # Check that the requestors first/last name do not exist self.assertNotIn("First", email_content) self.assertNotIn("Last", email_content) self.assertNotIn("First Last", email_content) @boto3_mocking.patching - def test_domain_invitation_email_has_email_as_requester(self): + def test_domain_invitation_email_has_email_as_requestor(self): """Inviting a user sends them an email, with email as the name.""" # Create a fake user object email_address = "mayor@igorville.gov" @@ -2662,13 +2662,13 @@ class TestDomainManagers(TestDomainOverview): email_content = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"] self.assertIn("info@example.com", email_content) - # Check that the requesters first/last name do not exist + # Check that the requestors first/last name do not exist self.assertNotIn("First", email_content) self.assertNotIn("Last", email_content) self.assertNotIn("First Last", email_content) @boto3_mocking.patching - def test_domain_invitation_email_has_email_as_requester_staff(self): + def test_domain_invitation_email_has_email_as_requestor_staff(self): """Inviting a user sends them an email, with email as the name.""" # Create a fake user object email_address = "mayor@igorville.gov" @@ -2705,7 +2705,7 @@ class TestDomainManagers(TestDomainOverview): email_content = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"] self.assertIn("help@get.gov", email_content) - # Check that the requesters first/last name do not exist + # Check that the requestors first/last name do not exist self.assertNotIn("First", email_content) self.assertNotIn("Last", email_content) self.assertNotIn("First Last", email_content) diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 4d47a6f59..2d634dbf2 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -646,7 +646,7 @@ class DomainAddUserView(DomainFormBaseView): """Get an absolute URL for this domain.""" return self.request.build_absolute_uri(reverse("domain", kwargs={"pk": self.object.id})) - def _send_domain_invitation_email(self, email: str, requester: User, add_success=True): + def _send_domain_invitation_email(self, email: str, requestor: User, add_success=True): """Performs the sending of the domain invitation email, does not make a domain information object email: string- email to send to @@ -654,16 +654,16 @@ class DomainAddUserView(DomainFormBaseView): adding a success message to the view if the email sending succeeds""" # Set a default email address to send to for staff - requester_email = "help@get.gov" + requestor_email = "help@get.gov" - # Check if the email requester has a valid email address - if not requester.is_staff and requester.email is not None and requester.email.strip() != "": - requester_email = requester.email - elif not requester.is_staff: + # Check if the email requestor has a valid email address + if not requestor.is_staff and requestor.email is not None and requestor.email.strip() != "": + requestor_email = requestor.email + elif not requestor.is_staff: messages.error(self.request, "Can't send invitation email. No email is associated with your account.") logger.error( f"Can't send email to '{email}' on domain '{self.object}'." - f"No email exists for the requester '{requester.username}'.", + f"No email exists for the requestor '{requestor.username}'.", exc_info=True, ) return None @@ -676,7 +676,7 @@ class DomainAddUserView(DomainFormBaseView): context={ "domain_url": self._domain_abs_url(), "domain": self.object, - "requester_email": requester_email, + "requestor_email": requestor_email, }, ) except EmailSendingError: @@ -691,7 +691,7 @@ class DomainAddUserView(DomainFormBaseView): if add_success: messages.success(self.request, f"{email} has been invited to this domain.") - def _make_invitation(self, email_address: str, requester: User): + def _make_invitation(self, email_address: str, requestor: User): """Make a Domain invitation for this email and redirect with a message.""" invitation, created = DomainInvitation.objects.get_or_create(email=email_address, domain=self.object) if not created: @@ -701,22 +701,22 @@ class DomainAddUserView(DomainFormBaseView): f"{email_address} has already been invited to this domain.", ) else: - self._send_domain_invitation_email(email=email_address, requester=requester) + self._send_domain_invitation_email(email=email_address, requestor=requestor) return redirect(self.get_success_url()) def form_valid(self, form): """Add the specified user on this domain.""" requested_email = form.cleaned_data["email"] - requester = self.request.user + requestor = self.request.user # look up a user with that email try: requested_user = User.objects.get(email=requested_email) except User.DoesNotExist: # no matching user, go make an invitation - return self._make_invitation(requested_email, requester) + return self._make_invitation(requested_email, requestor) else: # if user already exists then just send an email - self._send_domain_invitation_email(requested_email, requester, add_success=False) + self._send_domain_invitation_email(requested_email, requestor, add_success=False) try: UserDomainRole.objects.create( From 31dc26476c007a5553565181ee0698ba5270fa75 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Thu, 25 Jan 2024 14:50:22 -0500 Subject: [PATCH 5/5] migration fix --- ...y => 0064_alter_domainapplication_address_line1_and_more.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/registrar/migrations/{0063_alter_domainapplication_address_line1_and_more.py => 0064_alter_domainapplication_address_line1_and_more.py} (93%) diff --git a/src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py b/src/registrar/migrations/0064_alter_domainapplication_address_line1_and_more.py similarity index 93% rename from src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py rename to src/registrar/migrations/0064_alter_domainapplication_address_line1_and_more.py index 99ffac7aa..7241c7164 100644 --- a/src/registrar/migrations/0063_alter_domainapplication_address_line1_and_more.py +++ b/src/registrar/migrations/0064_alter_domainapplication_address_line1_and_more.py @@ -5,7 +5,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ("registrar", "0062_alter_host_name"), + ("registrar", "0063_veryimportantperson"), ] operations = [