18 lines
559 B
Python
18 lines
559 B
Python
from django.core.management.base import BaseCommand
|
|
from django.core.mail import send_mail
|
|
from allauth.account.models import EmailConfirmation
|
|
from inventory.tasks import send_email
|
|
from django.contrib.auth import get_user_model
|
|
|
|
User = get_user_model()
|
|
class Command(BaseCommand):
|
|
|
|
def handle(self, *args, **kwargs):
|
|
user = User.objects.last()
|
|
print(user.email)
|
|
# 2. Force email confirmation
|
|
# email = user.emailaddress_set.first()
|
|
confirmation = EmailConfirmation.create(user.email)
|
|
confirmation.send()
|
|
|