diff --git a/src/pretix/base/services/mail.py b/src/pretix/base/services/mail.py index 76a1c5ba65..8397523174 100644 --- a/src/pretix/base/services/mail.py +++ b/src/pretix/base/services/mail.py @@ -168,7 +168,7 @@ def render_mail(template, context): if context: body = body.format_map(TolerantDict(context)) body_md = bleach.linkify(bleach.clean(markdown.markdown(body), tags=bleach.ALLOWED_TAGS + [ - 'p', + 'p', 'pre' ])) else: tpl = get_template(template) diff --git a/src/pretix/plugins/banktransfer/payment.py b/src/pretix/plugins/banktransfer/payment.py index e4e9f61e59..74b0c66bfa 100644 --- a/src/pretix/plugins/banktransfer/payment.py +++ b/src/pretix/plugins/banktransfer/payment.py @@ -1,5 +1,5 @@ import json -import re +import textwrap from collections import OrderedDict from django.template.loader import get_template @@ -47,7 +47,7 @@ class BankTransfer(BasePaymentProvider): ctx = { 'event': self.event, 'order': order, - 'details': re.sub('^', ' ', self.settings.get('bank_details', as_type=LazyI18nString), flags=re.MULTILINE), + 'details': textwrap.indent(str(self.settings.get('bank_details', as_type=LazyI18nString)), ' '), } return template.render(ctx)