Commit e0851ad4 authored by alexAubin's avatar alexAubin
Browse files

Fix filter on membershipfee date (using a simple list comprehension because...

Fix filter on membershipfee date (using a simple list comprehension because not super familiar with annotate and joins etc..)
parent 2c002ce4
Pipeline #64 failed with stage
in 2 minutes and 43 seconds
...@@ -40,9 +40,10 @@ class Command(BaseCommand): ...@@ -40,9 +40,10 @@ class Command(BaseCommand):
dates=[str(d) for d in end_dates])) dates=[str(d) for d in end_dates]))
members = Member.objects.filter(status='member')\ members = Member.objects.filter(status='member')\
.annotate(end=Max('membership_fees__end_date'))\
.filter(end__in=end_dates)\
.filter(send_membership_fees_email=True) .filter(send_membership_fees_email=True)
members = [member for member in members if member.end_date_of_membership() in end_dates]
if verbosity >= 2: if verbosity >= 2:
self.stdout.write( self.stdout.write(
"Got {number} members.".format(number=members.count())) "Got {number} members.".format(number=members.count()))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment