diff --git a/src/registrar/models/domain.py b/src/registrar/models/domain.py index 649b3f93d..d738b6bcc 100644 --- a/src/registrar/models/domain.py +++ b/src/registrar/models/domain.py @@ -780,7 +780,7 @@ class Domain(TimeStampedModel, DomainHelper): try: return self._get_property("statuses") except KeyError: - logger.error("Can't retrieve status from domain info") + logger.error("Can’t retrieve status from domain info") return [] @statuses.setter # type: ignore @@ -857,7 +857,7 @@ class Domain(TimeStampedModel, DomainHelper): if rem: action = "remove" - raise Exception("Can't %s the contact of type %s" % (action, contact.contact_type)) + raise Exception("Can’t %s the contact of type %s" % (action, contact.contact_type)) @Cache def security_contact(self) -> PublicContact | None: @@ -2087,7 +2087,7 @@ class Domain(TimeStampedModel, DomainHelper): def _get_or_create_public_contact(self, public_contact: PublicContact): """Tries to find a PublicContact object in our DB. - If it can't, it'll create it. Returns PublicContact""" + If it can’t, it'll create it. Returns PublicContact""" db_contact = PublicContact.objects.filter( registry_id=public_contact.registry_id, contact_type=public_contact.contact_type, diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index 1cca3742f..9d93fa578 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -862,7 +862,7 @@ class DomainRequest(TimeStampedModel): self.approved_domain = None except Exception as err: logger.error(err) - logger.error(f"Can't query an approved domain while attempting {called_from}") + logger.error(f"Can’t query an approved domain while attempting {called_from}") # Delete the suborg as long as this is the only place it is used self._cleanup_dangling_suborg() diff --git a/src/registrar/templates/includes/banner-system-outage.html b/src/registrar/templates/includes/banner-system-outage.html index 60fc4eb03..638cb6843 100644 --- a/src/registrar/templates/includes/banner-system-outage.html +++ b/src/registrar/templates/includes/banner-system-outage.html @@ -5,7 +5,7 @@ System outage

- Oct 16, 24:00 UTC: We're investigating an outage on the .gov registrar. The .gov zone and individual domains remain online. However, you can't request a new domain or manage an existing one at this time. + Oct 16, 24:00 UTC: We're investigating an outage on the .gov registrar. The .gov zone and individual domains remain online. However, you can’t request a new domain or manage an existing one at this time.

diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index 9447d211f..cfdc866d0 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -526,7 +526,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -595,7 +595,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -661,7 +661,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -943,7 +943,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -1010,7 +1010,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -1076,7 +1076,7 @@ class TestDomainInvitationAdmin(WebTest): # Assert error message mock_messages_error.assert_called_once_with( - request, "Can't send invitation email. No email is associated with your user account." + request, "Can’t send invitation email. No email is associated with your user account." ) # Assert the invitations were saved @@ -1484,7 +1484,7 @@ class TestPortfolioInvitationAdmin(TestCase): # Assert that messages.error was called with the correct message mock_messages_error.assert_called_once_with( request, - "Can't send invitation email. No email is associated with your user account.", + "Can’t send invitation email. No email is associated with your user account.", ) @less_console_noise_decorator diff --git a/src/registrar/tests/test_email_invitations.py b/src/registrar/tests/test_email_invitations.py index 77a8c402f..4d9e286aa 100644 --- a/src/registrar/tests/test_email_invitations.py +++ b/src/registrar/tests/test_email_invitations.py @@ -531,7 +531,7 @@ class PortfolioInvitationEmailTests(unittest.TestCase): send_portfolio_invitation_email(self.email, self.requestor, self.portfolio, is_admin_invitation) self.assertIn( - "Can't send invitation email. No email is associated with your user account.", str(context.exception) + "Can’t send invitation email. No email is associated with your user account.", str(context.exception) ) @less_console_noise_decorator @@ -869,7 +869,7 @@ class SendPortfolioAdminRemovalEmailsTests(unittest.TestCase): mock_get_requestor_email.assert_called_once_with(self.requestor, portfolio=self.portfolio) mock_send_removal_emails.assert_not_called() # Should not proceed if email retrieval fails self.assertEqual( - str(context.exception), "Can't send invitation email. No email is associated with your user account." + str(context.exception), "Can’t send invitation email. No email is associated with your user account." ) @less_console_noise_decorator diff --git a/src/registrar/tests/test_nameserver_error.py b/src/registrar/tests/test_nameserver_error.py index be9a26f6f..35e218fd2 100644 --- a/src/registrar/tests/test_nameserver_error.py +++ b/src/registrar/tests/test_nameserver_error.py @@ -20,7 +20,7 @@ class TestNameserverError(TestCase): """Test NameserverError when no ip address and no nameserver is passed""" nameserver = "nameserver val" - expected = "You can't have more than 13 nameservers." + expected = "You can’t have more than 13 nameservers." nsException = NameserverError(code=nsErrorCodes.TOO_MANY_HOSTS, nameserver=nameserver) self.assertEqual(nsException.message, expected) diff --git a/src/registrar/tests/test_views_domain.py b/src/registrar/tests/test_views_domain.py index b84d284d8..de1d53ebb 100644 --- a/src/registrar/tests/test_views_domain.py +++ b/src/registrar/tests/test_views_domain.py @@ -1331,7 +1331,7 @@ class TestDomainManagers(TestDomainOverview): self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) add_page.form.submit() - expected_message_content = "Can't send invitation email. No email is associated with your user account." + expected_message_content = "Can’t send invitation email. No email is associated with your user account." # Assert that the error message was called with the correct argument mock_error.assert_called_once_with( diff --git a/src/registrar/tests/test_views_portfolio.py b/src/registrar/tests/test_views_portfolio.py index 052155bb0..176437b5c 100644 --- a/src/registrar/tests/test_views_portfolio.py +++ b/src/registrar/tests/test_views_portfolio.py @@ -1696,12 +1696,16 @@ class TestPortfolioMemberDeleteView(WebTest): self.assertEqual(response.status_code, 400) # Bad request due to active requests support_url = "https://get.gov/contact/" expected_error_message = ( - "This member can't be removed from the organization because they have an active domain request. " + "This member can\u2019t be removed from the organization because they have an active domain request. " f"Please contact us " "to remove this member." ) - self.assertContains(response, expected_error_message, status_code=400) + # The curly apostrophe \u2019 requires us to do a bit more work before we can assert + response_json = json.loads(response.content.decode("utf-8")) + self.assertEqual(response.status_code, 400) # Ensure it's a bad request + self.assertIn("error", response_json) # Ensure the "error" key exists + self.assertEqual(response_json["error"], expected_error_message) # Compare actual vs expected message # assert that send_portfolio_admin_removal_emails is not called send_removal_emails.assert_not_called() @@ -1956,7 +1960,7 @@ class TestPortfolioMemberDeleteView(WebTest): support_url = "https://get.gov/contact/" expected_error_message = ( - "This member can't be removed from the organization because they have an active domain request. " + "This member can’t be removed from the organization because they have an active domain request. " f"Please contact us " "to remove this member." ) diff --git a/src/registrar/utility/errors.py b/src/registrar/utility/errors.py index 0a6f00c36..c7a353f67 100644 --- a/src/registrar/utility/errors.py +++ b/src/registrar/utility/errors.py @@ -48,13 +48,13 @@ class MissingEmailError(InvitationError): def __init__(self, email=None, domain=None, portfolio=None): # Default message if no additional info is provided - message = "Can't send invitation email. No email is associated with your user account." + message = "Can’t send invitation email. No email is associated with your user account." # Customize message based on provided arguments if email and domain: - message = f"Can't send email to '{email}' on domain '{domain}'. No email exists for the requestor." + message = f"Can’t send email to '{email}' on domain '{domain}'. No email exists for the requestor." elif email and portfolio: - message = f"Can't send email to '{email}' for portfolio '{portfolio}'. No email exists for the requestor." + message = f"Can’t send email to '{email}' for portfolio '{portfolio}'. No email exists for the requestor." super().__init__(message) @@ -201,7 +201,7 @@ class NameserverError(Exception): NameserverErrorCodes.MISSING_IP: ("Using your domain for a name server requires an IP address."), NameserverErrorCodes.GLUE_RECORD_NOT_ALLOWED: ("Name server address does not match domain name"), NameserverErrorCodes.INVALID_IP: ("{}: Enter an IP address in the required format."), - NameserverErrorCodes.TOO_MANY_HOSTS: ("You can't have more than 13 nameservers."), + NameserverErrorCodes.TOO_MANY_HOSTS: ("You can’t have more than 13 nameservers."), NameserverErrorCodes.MISSING_HOST: ("You must provide a name server to enter an IP address."), NameserverErrorCodes.INVALID_HOST: ("Enter a name server in the required format, like ns1.example.com"), NameserverErrorCodes.DUPLICATE_HOST: ( diff --git a/src/registrar/views/portfolios.py b/src/registrar/views/portfolios.py index 2fdafe9ca..be91cc06a 100644 --- a/src/registrar/views/portfolios.py +++ b/src/registrar/views/portfolios.py @@ -935,7 +935,7 @@ class PortfolioAddMemberView(PortfolioMembersPermissionView, FormMixin): elif isinstance(exception, MissingEmailError): messages.error(self.request, str(exception)) logger.error( - f"Can't send email to '{email}' for portfolio '{portfolio}'. No email exists for the requestor.", + f"Can’t send email to '{email}' for portfolio '{portfolio}'. No email exists for the requestor.", exc_info=True, ) else: