Skip trying to send confirmation emails to accounts without email addresses
This commit is contained in:
parent
5c30446c5a
commit
11da53e006
1 changed files with 2 additions and 0 deletions
|
@ -21,6 +21,8 @@ class Command(BaseCommand):
|
||||||
site = Site.objects.get(id=1)
|
site = Site.objects.get(id=1)
|
||||||
accounts = Account.objects.filter(is_email_confirmed=False)
|
accounts = Account.objects.filter(is_email_confirmed=False)
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
|
if not account.user.email:
|
||||||
|
break # Skip accounts without an email
|
||||||
confirmation_request = EmailConfirmation.objects.filter(user=account.user)
|
confirmation_request = EmailConfirmation.objects.filter(user=account.user)
|
||||||
|
|
||||||
if 'days' in options and options.get('days', None):
|
if 'days' in options and options.get('days', None):
|
||||||
|
|
Loading…
Reference in a new issue