From 4471307b376a3bd19f146b2718960c5f17692d8c Mon Sep 17 00:00:00 2001 From: misterkrafts Date: Thu, 6 Apr 2023 17:57:32 +0200 Subject: [PATCH] Ignore club notes that are used by the BDE for particular events --- management/commands/send_mail_to_negative_balances.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/commands/send_mail_to_negative_balances.py b/management/commands/send_mail_to_negative_balances.py index 427bd8f..0596e2a 100644 --- a/management/commands/send_mail_to_negative_balances.py +++ b/management/commands/send_mail_to_negative_balances.py @@ -32,9 +32,9 @@ class Command(BaseCommand): notes = Note.objects.filter( Q(noteuser__user__memberships__date_end__gte= date.today() - timedelta(days=int(365.25 * options['add_years']))) - | Q(noteclub__isnull=False), + | (Q(noteclub__isnull=False) & ~Q(noteclub__club__name__icontains='- BDE')), balance__lte=-options["negative_amount"], - is_active=True, + is_active=True, ).order_by('balance').distinct().all() if options["spam"]: