From a49466a93a1bf98f9302fa98b4eb91b05f18f7df Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 27 Jun 2024 15:54:13 -0400 Subject: [PATCH] membershipworks: Apply new "Members" ticket-based pricing to classes after 2024-07-01 --- membershipworks/models.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index aff6719..5b53127 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -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