From 824c37df04ac176f1fef8d9dabd6ce033134888b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 3 Feb 2024 23:33:19 -0500 Subject: [PATCH] membershipworks: Ignore EventExt.materials_fee_included_in_price when materials fee is 0 --- membershipworks/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 0c969ab..7c18cb4 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -592,10 +592,10 @@ class EventTicketTypeManager(models.Manager["EventTicketType"]): ), is_members_ticket=(Q(restrict_to__isnull=False)), materials=Case( - When(Q(event__materials_fee_included_in_price__isnull=True), None), When( ( Q(event__materials_fee_included_in_price=True) + | Q(event__materials_fee=0) & Q(event__materials_fee__isnull=False) ), ExpressionWrapper( @@ -603,6 +603,7 @@ class EventTicketTypeManager(models.Manager["EventTicketType"]): output_field=models.DecimalField(), ), ), + When(Q(event__materials_fee_included_in_price__isnull=True), None), default=0, output_field=models.DecimalField(), ),