Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions patchwork/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ def delete_notifications():
'patchwork/mails/patch-change-notification.txt', context
)

# Got one case where recipient.email == "<>". That causes Django to fail with:
# File "/usr/lib/python3/dist-packages/django/core/mail/message.py", line 99, in sanitize_address
# address_parts = nm + localpart + domain
# ~~~^~~~~~~~~~~
# TypeError: can only concatenate str (not "NoneType") to str
if (
not recipient.email
or recipient.email == '<>'
or recipient.email == ''
):
errors.append((recipient, 'Invalid recipient'))
delete_notifications()
continue

message = EmailMessage(
subject=subject,
body=content,
Expand Down
Loading