Do not crash email layout preview with unknown placeholders

This commit is contained in:
Raphael Michel
2022-03-17 09:41:15 +01:00
parent cb7e014966
commit 9ffeafa6a5

View File

@@ -92,6 +92,7 @@ from ...base.i18n import language
from ...base.models.items import (
Item, ItemCategory, ItemMetaProperty, Question, Quota,
)
from ...base.services.mail import TolerantDict
from ...base.settings import SETTINGS_AFFECTING_CSS, LazyI18nStringList
from ..logdisplay import OVERVIEW_BANLIST
from . import CreateView, PaginationMixin, UpdateView
@@ -729,7 +730,7 @@ class MailSettingsRendererPreview(MailSettingsPreview):
def get(self, request, *args, **kwargs):
v = str(request.event.settings.mail_text_order_placed)
v = v.format_map(self.placeholders('mail_text_order_placed'))
v = v.format_map(TolerantDict(self.placeholders('mail_text_order_placed')))
renderers = request.event.get_html_mail_renderers()
if request.GET.get('renderer') in renderers:
with rolledback_transaction():