carltongibson / django-unique-user-email

Enable login-by-email with the default User model for your Django project by making auth.User.email unique.
MIT License
136 stars 6 forks source link

Compatibility with custom User model #9

Closed H4rryK4ne closed 6 months ago

H4rryK4ne commented 6 months ago

Hi Carlton,

In my project I followed the django documentation suggestion to create a custom User model (although nothing actually happens there). To make your app run with a custom User model I needed to change it a bit.

Instead of importing from django.contrib.auth.models import User I used User = get_user_model() .

I can create a PR If you like this.

carltongibson commented 6 months ago

Hi @H4rryK4ne — this project doesn't make any sense if you use a custom user model.

If you do that, just make the email field unique. You might even make it your USERNAME_FIELD