Unverified Commit 9b58200f authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Thom Wiggers
Browse files

Filter out members without email address in members email tests

parent 13382025
......@@ -21,6 +21,7 @@ def send_membership_announcement(dry_run=False):
members = (Member.current_members
.filter(membership__until__isnull=True)
.exclude(membership__type=Membership.HONORARY)
.exclude(email='')
.distinct())
with mail.get_connection() as connection:
......@@ -58,7 +59,7 @@ def send_information_request(dry_run=False):
:param dry_run: does not really send emails if True
"""
members = Member.current_members.all()
members = Member.current_members.all().exclude(email='')
with mail.get_connection() as connection:
for member in members:
......@@ -101,6 +102,7 @@ def send_expiration_announcement(dry_run=False):
members = (Member.current_members
.filter(membership__until__lte=expiry_date)
.exclude(membership__until__isnull=True)
.exclude(email='')
.distinct())
with mail.get_connection() as connection:
......
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