Strip [] in mail subject prefix (#950)

This commit is contained in:
Tobias Kunze
2018-06-19 12:46:08 +02:00
committed by Raphael Michel
parent 0357386f7c
commit e187005130

View File

@@ -114,6 +114,8 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString],
headers['Reply-To'] = event.settings.contact_mail
prefix = event.settings.get('mail_prefix')
if prefix and prefix.startswith('[') and prefix.endswith(']'):
prefix = prefix[1:-1]
if prefix:
subject = "[%s] %s" % (prefix, subject)