From 60bbe18322683be25acd3bfa0111aaaa2d2d2d39 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 3 Jan 2023 16:37:46 -0500 Subject: [PATCH] membershipworks: Require "Members" or "CMS Staff" folder for `is_active` check --- membershipworks/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 8b24f5d..5092d5f 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -138,7 +138,11 @@ class Member(models.Model): @classmethod def with_is_active(cls): return cls.objects.annotate( - is_active=~( + is_active=( + Q(flags__name="Members", flags__type="folder") + | Q(flags__name="CMS Staff", flags__type="folder") + ) + & ~( Q(flags__name="Account On Hold", flags__type="label") | Q(flags__name="CMS Membership on hold", flags__type="level") | Q(flags__name="Former Members", flags__type="folder")