From 11da53e0060d6bc90fc869d3559531738133f382 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Mon, 5 Mar 2018 20:44:23 -0500 Subject: [PATCH] Skip trying to send confirmation emails to accounts without email addresses --- .../management/commands/send_email_confirmation_reminder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/get_together/management/commands/send_email_confirmation_reminder.py b/get_together/management/commands/send_email_confirmation_reminder.py index ae8ce5e..aea3050 100644 --- a/get_together/management/commands/send_email_confirmation_reminder.py +++ b/get_together/management/commands/send_email_confirmation_reminder.py @@ -21,6 +21,8 @@ class Command(BaseCommand): site = Site.objects.get(id=1) accounts = Account.objects.filter(is_email_confirmed=False) for account in accounts: + if not account.user.email: + break # Skip accounts without an email confirmation_request = EmailConfirmation.objects.filter(user=account.user) if 'days' in options and options.get('days', None):