-
Notifications
You must be signed in to change notification settings - Fork 85
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
Catch EmailAddressExceptions
and return 400
#464
Conversation
because the source address is part of the application config. (It should really be validated once at startup IMO.)
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.
Looks good overall! A couple of minor things (and linting seems to fail).
I'd rather put the comment next to the code that checks it
I thought `raise expr from e` would include `e`'s string representation, but it doens't; rather `raise expr from e` seems to replace all mention of `e` and its stack frames from the traceback.
sydent/util/emailutils.py
Outdated
@@ -129,6 +125,25 @@ def sendEmail( | |||
raise EmailSendException() from origException | |||
|
|||
|
|||
def check_valid_email_address(address: str, allow_description: bool = True) -> None: |
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.
Does this want allow_description
to default to False
?
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.
Argh, it does. Thank you, I need to slow down and think more carefully.
40890cd
to
b101614
Compare
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.
Looks great!
Cheers! |
Fixes #451