From 08417ecce9da7ceb8eb1d70928ce07ed8d5c2210 Mon Sep 17 00:00:00 2001 From: Rafee Date: Thu, 21 Mar 2024 11:48:03 -0400 Subject: [PATCH] Error code name update --- api/tests/views_tests.py | 4 ++-- emails/models.py | 2 +- privaterelay/pending_locales/en/pending.ftl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/tests/views_tests.py b/api/tests/views_tests.py index eaf5ca242d..bbd7f4c8b8 100644 --- a/api/tests/views_tests.py +++ b/api/tests/views_tests.py @@ -573,7 +573,7 @@ def test_patch_domainaddress_address_fails( assert response.status_code == 400 assert ret_data["detail"] == "You cannot edit an existing domain address field." - assert ret_data["error_code"] == "address_exists" + assert ret_data["error_code"] == "address_not_editable" assert get_glean_event(caplog) is None @@ -599,7 +599,7 @@ def test_patch_domainaddress_addr_with_id_fails( assert response.status_code == 400 assert ret_data["detail"] == "You cannot edit an existing domain address field." - assert ret_data["error_code"] == "address_exists" + assert ret_data["error_code"] == "address_not_editable" assert get_glean_event(caplog) is None diff --git a/emails/models.py b/emails/models.py index 35f86583a4..67f3506539 100644 --- a/emails/models.py +++ b/emails/models.py @@ -689,7 +689,7 @@ class DomainAddrNeedSubdomainException(CannotMakeAddressException): class DomainAddrUpdateException(CannotMakeAddressException): """Exception raised when attempting to edit an existing domain address field.""" - default_code = "address_exists" + default_code = "address_not_editable" default_detail = "You cannot edit an existing domain address field." status_code = 400 diff --git a/privaterelay/pending_locales/en/pending.ftl b/privaterelay/pending_locales/en/pending.ftl index 21ba6491af..ff57e8d7b6 100644 --- a/privaterelay/pending_locales/en/pending.ftl +++ b/privaterelay/pending_locales/en/pending.ftl @@ -7,4 +7,4 @@ # Variables: # $duplicate_address (string) - User-set email address that already exists api-error-duplicate-address = “{ $duplicate_address }” already exists. Please try again with a different mask name. -api-error-address-exists = You cannot edit an existing domain address field. +api-error-address-not-editable = You cannot edit an existing domain address field.