Skip to content

Commit

Permalink
Error code name update
Browse files Browse the repository at this point in the history
  • Loading branch information
rafeerahman committed Mar 21, 2024
1 parent e0ea30f commit 08417ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/tests/views_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion emails/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion privaterelay/pending_locales/en/pending.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 08417ec

Please sign in to comment.