membershipworks: Apply new "Members" ticket-based pricing to classes after 2024-07-01
This commit is contained in:
parent
682ebefc81
commit
a49466a93a
@ -680,13 +680,19 @@ class EventTicketTypeManager(models.Manager["EventTicketType"]):
|
||||
)
|
||||
qs = super().get_queryset()
|
||||
return qs.annotate(
|
||||
# Before 2024-07-01, use Members ticket price for any
|
||||
# restricted ticket, but list price for unrestricted
|
||||
# (Non-Members) ticket. After, use Members ticket price
|
||||
# for all tickets.
|
||||
actual_price=Case(
|
||||
When(
|
||||
Q(restrict_to=members_folder) | Q(restrict_to__isnull=True),
|
||||
Q(restrict_to=members_folder)
|
||||
| (
|
||||
Q(event__start__lt=datetime(year=2024, month=7, day=1))
|
||||
& Q(restrict_to__isnull=True)
|
||||
),
|
||||
"list_price",
|
||||
),
|
||||
# Use Members ticket price for any restricted ticket
|
||||
# which is not the Members ticket
|
||||
default=Subquery(
|
||||
qs.filter(
|
||||
event=OuterRef("event"), restrict_to=members_folder
|
||||
|
Loading…
Reference in New Issue
Block a user