mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Placeholders in subject were not being replaced because there was no `.format()` called on the subject. This commit creates a context dict that is used for both the body and the subject. It is then replaced using `.format_map()` Fixes https://github.com/pretix/pretix/issues/531
This commit is contained in:
committed by
Raphael Michel
parent
96dd4e02f3
commit
58938fc07c
@@ -23,7 +23,11 @@ class MailForm(forms.Form):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields['subject'] = I18nFormField(
|
||||
widget=I18nTextInput, required=True,
|
||||
locales=event.settings.get('locales')
|
||||
locales=event.settings.get('locales'),
|
||||
help_text=_("Available placeholders: {expire_date}, {event}, {code}, {date}, {url}, "
|
||||
"{invoice_name}, {invoice_company}"),
|
||||
validators=[PlaceholderValidator(['{expire_date}', '{event}', '{code}', '{date}', '{url}',
|
||||
'{invoice_name}', '{invoice_company}'])]
|
||||
)
|
||||
self.fields['message'] = I18nFormField(
|
||||
widget=I18nTextarea, required=True,
|
||||
|
||||
Reference in New Issue
Block a user