Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration form is incompatible with custom user models #19

Open
AntonGrigorievich opened this issue Jun 5, 2024 · 0 comments
Open

Comments

@AntonGrigorievich
Copy link

as you can see here
If you reference User directly (for example, by referring to it in a foreign key), your code will not work in projects where the AUTH_USER_MODEL setting has been changed to a different user model.

In your RegistrationForm you do just that, which causes an error Manager isn't available; 'auth.User' has been swapped for 'users.User'

As I see it only happens in one form in forms.py, so fixing this problem and making your users' lives will be very easy.

from django.contrib.auth import get_user_model
# model = User
model = get_user_model()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant