Scheduled mails: Allow subevent-dependent placeholders (Z#23171818) (#4629)

This commit is contained in:
Raphael Michel
2024-11-19 10:50:10 +01:00
committed by GitHub
parent 4b8416df8f
commit 76ecec8b98
4 changed files with 59 additions and 6 deletions

View File

@@ -215,7 +215,11 @@ def base_placeholders(sender, **kwargs):
),
SimpleFunctionalTextPlaceholder(
'event', ['event_or_subevent'], lambda event_or_subevent: event_or_subevent.name,
lambda event_or_subevent: event_or_subevent.name
lambda event: event.subevents.first().name if event.has_subevents else event.name,
),
SimpleFunctionalTextPlaceholder(
'event_series_name', ['event', 'event_or_subevent'], lambda event, event_or_subevent: event.name,
lambda event: event.name
),
SimpleFunctionalTextPlaceholder(
'event_slug', ['event'], lambda event: event.slug, lambda event: event.slug