membershipworks: Correctly invert is_active check on Member

This commit is contained in:
Adam Goldsmith 2022-12-25 10:20:50 -05:00
parent a9dcda9508
commit a53c9409bb

View File

@ -138,9 +138,11 @@ class Member(models.Model):
@classmethod
def with_is_active(cls):
return cls.objects.annotate(
is_active=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")
is_active=~(
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")
)
)