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-3827: Move non-model code out of emails/models.py #4799

Merged
merged 7 commits into from
Jun 21, 2024

Conversation

jwhitlock
Copy link
Member

This PR moves code around, in preparation for moving Profile (and other models) from the emails app to the privaterelay app.

  • emails/exceptions.py - Defines the exceptions raised in the emails app
  • emails/validators.py - Defines the validator functions used in the emails app.
  • emails/models.py
    • The remaining functions have moved to the top of the file, and have type hints.
    • DomainAddress.make_domain_address used to take a Profile, and now takes a User.

This also involved moving tests around, and some test changes for the new interfaces.

Update the signature of valid_available_subdomain to be a field
validator, raising an exception on failure and returning None.
DomainAddress.make_domain_address used to take a Profile argument, and
now takes a User argument. This will allow other functions to take a
User instead of a Profile, and avoid circular imports.
emails/models.py Show resolved Hide resolved
@groovecoder groovecoder added this pull request to the merge queue Jun 21, 2024
Merged via the queue into main with commit ba2d78a Jun 21, 2024
29 checks passed
@groovecoder groovecoder deleted the split-exceptions-validators-mpp-3827 branch June 21, 2024 14:02
Copy link

sentry-io bot commented Jul 3, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'ato... /api/v1/relayaddresses/ View Issue

Did you find this useful? React with a 👍 or 👎

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