-
Notifications
You must be signed in to change notification settings - Fork 4
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
Filtrer les emails non valides avant l'envoie #1645
base: main
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
invalid_emails = set(self.to_emails) - set(valid_to_emails) | ||
|
||
if not valid_to_emails: | ||
raise Exception("No valid recipient for email") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise Exception("No valid recipient for email") | |
raise ValueError("No valid recipient for email") |
@@ -25,6 +26,25 @@ def test_basic_send_transactional_email(self): | |||
"email_param_value", | |||
) | |||
|
|||
def test_send_transactional_email_no_emails_valid(self): | |||
with pytest.raises(Exception, match="recipient for email"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with pytest.raises(Exception, match="recipient for email"): | |
with pytest.raises(ValueError, match="recipient for email"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description succincte du problème résolu
Erreur Sentry : https://sentry.incubateur.net/organizations/betagouv/issues/130638/?environment=production&project=29&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=14d&stream_index=5
Certain utilisateur n'ont pas d'email correct, on ignore ces emails et on log un wanning
Type de changement :
Auto-review
Les trucs à faire avant de demander une review :
.env.template
Comment tester
En local / staging :