rename to download_reminder

This commit is contained in:
Felix Rindt
2020-07-24 17:57:25 +02:00
parent 143ac10991
commit 4a0a3aff59
6 changed files with 7 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ def set_sales_channels(apps, schema_editor):
Event_SettingsStore.objects.bulk_create([
Event_SettingsStore(
object=event,
key="mail_sales_channel_ticket_reminder",
key="mail_sales_channel_download_reminder",
value=all_sales_channels)
for event in Event.objects.all()
], batch_size=batch_size)

View File

@@ -1057,7 +1057,7 @@ def send_download_reminders(sender, **kwargs):
if days is None:
continue
if o.sales_channel not in event.settings.mail_sales_channel_ticket_reminder:
if o.sales_channel not in event.settings.mail_sales_channel_download_reminder:
continue
reminder_date = (o.first_date - timedelta(days=days)).replace(hour=0, minute=0, second=0, microsecond=0)

View File

@@ -1194,7 +1194,7 @@ DEFAULTS = {
'default': ['web'],
'type': list,
},
'mail_sales_channel_ticket_reminder': {
'mail_sales_channel_download_reminder': {
'default': ['web'],
'type': list,
},

View File

@@ -751,7 +751,7 @@ def multimail_validate(val):
def contains_web_channel_validate(val):
if "web" not in val:
raise ValidationError(_("The web channel must be selected to receive these emails."))
raise ValidationError(_("The online shop must be selected to receive these emails."))
class MailSettingsForm(SettingsForm):
@@ -773,7 +773,7 @@ class MailSettingsForm(SettingsForm):
validators=[contains_web_channel_validate],
)
mail_sales_channel_ticket_reminder = forms.MultipleChoiceField(
mail_sales_channel_download_reminder = forms.MultipleChoiceField(
choices=lambda: [(ident, sc.verbose_name) for ident, sc in get_all_sales_channels().items()],
label=_('Sales Channels'),
help_text=_('This email will only be send to orders from these sales channels. The online shop must be enabled.'),

View File

@@ -71,7 +71,7 @@
{% include "pretixcontrol/event/mail_settings_fragment.html" with pid="custom_mail" title=title_order_custom_mail items="mail_text_order_custom_mail" %}
{% blocktrans asvar title_download_tickets_reminder %}Reminder to download tickets{% endblocktrans %}
{% include "pretixcontrol/event/mail_settings_fragment.html" with pid="ticket_reminder" title=title_download_tickets_reminder items="mail_days_download_reminder,mail_text_download_reminder,mail_send_download_reminder_attendee,mail_text_download_reminder_attendee,mail_sales_channel_ticket_reminder" exclude="mail_days_download_reminder,mail_send_download_reminder_attendee,mail_sales_channel_ticket_reminder" %}
{% include "pretixcontrol/event/mail_settings_fragment.html" with pid="ticket_reminder" title=title_download_tickets_reminder items="mail_days_download_reminder,mail_text_download_reminder,mail_send_download_reminder_attendee,mail_text_download_reminder_attendee,mail_sales_channel_download_reminder" exclude="mail_days_download_reminder,mail_send_download_reminder_attendee,mail_sales_channel_download_reminder" %}
{% blocktrans asvar title_require_approval %}Order approval process{% endblocktrans %}
{% include "pretixcontrol/event/mail_settings_fragment.html" with pid="ticket_reminder" title=title_require_approval items="mail_text_order_placed_require_approval,mail_text_order_approved,mail_text_order_denied" %}

View File

@@ -546,7 +546,7 @@ class DownloadReminderTests(TestCase):
@classscope(attr='o')
def test_not_sent_for_disabled_sales_channel(self):
self.event.settings.mail_days_download_reminder = 2
self.event.settings.mail_sales_channel_ticket_reminder = []
self.event.settings.mail_sales_channel_download_reminder = []
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 0