ext.notifications: Avoid error if headers are None
If using the uwsgi e-mail system, the attempt to do headers.encode()
would cause an AttributeError if there were no headers.
@@ -168,7 +168,10 @@ class SMTP(object):
if not subject:
# Fallback, just in case as an empty subject does not work
subject = 'isso notification'
+
if uwsgi:
+ if not headers:
+ headers = ''
uwsgi.spool({b"subject": subject.encode("utf-8"),
b"body": body.encode("utf-8"),
b"to": to.encode("utf-8"),
