- If I've an emailadress only
- If I don't care about a password atm (user will login through a "token link" later)
In pure Django I would just do it like:
from django.contrib.auth.models import User
user = User.objects.create_user(username=email, email=email)
But django allauth comes with this EmailAdress
stuff. Do I just have to create one of these too and then I'm fine?
from allauth.account.models import EmailAddress
EmailAddress.objects.create(user=user, email=email, primary=True, verified=False)
I don't want to break some django allauth logic and the existing adapter methods doesn't suit my needs.
EDIT: replaced setup_user_email
with EmailAddress
EDIT2: replaced add_email
with create
, want to set primary=True