From da7f03aa5310cd029f9b0c4db5081e34480f5ae4 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 20 Oct 2022 17:31:33 +0200 Subject: [PATCH] fix flask_mail --- ereuse_devicehub/mail/flask_mail.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/mail/flask_mail.py b/ereuse_devicehub/mail/flask_mail.py index 44e968af..ced76377 100644 --- a/ereuse_devicehub/mail/flask_mail.py +++ b/ereuse_devicehub/mail/flask_mail.py @@ -34,6 +34,9 @@ PY3 = sys.version_info[0] == 3 PY34 = PY3 and sys.version_info[1] >= 4 +basestring = str +unicode = str + if PY3: string_types = (str,) text_type = str @@ -65,6 +68,7 @@ def force_text(s, encoding='utf-8', errors='strict'): If strings_only is True, don't convert (some) non-string-like objects. """ + strings_only = True if isinstance(s, text_type): return s @@ -316,7 +320,7 @@ class Message(object): charset = self.charset or 'utf-8' return MIMEText(text, _subtype=subtype, _charset=charset) - def _message(self): + def _message(self): # noqa: C901 """Creates the email""" ascii_attachments = current_app.extensions['mail'].ascii_attachments encoding = self.charset or 'utf-8'