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

MPP-3753: Disable DomainAddress address field updates #4519

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

rafeerahman
Copy link
Contributor

@rafeerahman rafeerahman commented Mar 19, 2024

This PR fixes MPP-3753.

New feature description

Disables updates to the address field for DomainAddress'.

Screenshot (if applicable)

Not applicable.

How to test

  1. Log in or create account with premium emails and a domain locally

  2. Create a new domain mask

  3. Go to api/v1/docs/#/domainaddresses/domainaddresses_list, select GET /api/v1/domainaddresses/, click “Try it out”, scroll down and then click “Execute”, to get the list of domain addresses. Get the ID for the new domain mask.

  4. Still on api/v1/docs/#/domainaddresses/domainaddresses_list, select PATCH /api/v1/domainaddresses/{id}/. Click “Try it out”, enter the ID for the new domain mask, and enter JSON that changes the address, such as {"address": "Huh-You-Can-Change-This"}.

Checklist (Definition of Done)

  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • Customer Experience team has seen or waived a demo of functionality.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • I've added or updated relevant docs in the docs/ directory
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.
  • All UI revisions follow the coding standards, and use Protocol tokens where applicable (see /frontend/src/styles/tokens.scss).
  • Commits in this PR are minimal and have descriptive commit messages.
  • l10n changes have been submitted to the l10n repository, if any.

@rafeerahman rafeerahman added the 🚧 WIP Work in Progress label Mar 19, 2024
@rafeerahman rafeerahman requested a review from say-yawn March 20, 2024 16:03
@rafeerahman rafeerahman removed the 🚧 WIP Work in Progress label Mar 20, 2024
@rafeerahman rafeerahman self-assigned this Mar 20, 2024
Copy link
Contributor

@say-yawn say-yawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change recommended. Is there a PR to the locales repo for the new error too?

emails/models.py Outdated
class DomainAddrUpdateException(CannotMakeAddressException):
"""Exception raised when attempting to edit an existing domain address field."""

default_code = "address_exists"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default_code = "address_exists"
default_code = "address_not_editable"

The previous error code makes it confusing to another error where the domain address cannot be created because an address exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed these changes, 08417ec

@@ -560,6 +560,49 @@ def test_patch_domainaddress_read_only_mask_type(
assert get_glean_event(caplog) is None


def test_patch_domainaddress_address_fails(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on tests!

@rafeerahman
Copy link
Contributor Author

Small change recommended. Is there a PR to the locales repo for the new error too?

Put a PR up here, mozilla-l10n/fx-private-relay-l10n#169. Also looks like api-error-duplicate-address from pending.ftl was not in the locales repo, so included that in the PR.

@rafeerahman rafeerahman added this pull request to the merge queue Mar 21, 2024
Merged via the queue into main with commit 8865722 Mar 21, 2024
29 checks passed
@rafeerahman rafeerahman deleted the MPP-3753 branch March 21, 2024 16:12
jwhitlock added a commit that referenced this pull request Mar 26, 2024
This was handled in PR #4519 by making it an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants