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

Use custom user model in RegistrationForm #236

Closed

Conversation

confuzeus
Copy link

By default, Django will use its own default User model when initializing the CreationForm.

This will cause FieldErrors to be raised when a customer user model is provided but doesn't contain the same fields as in Django's default implementation.

That's why we use the custom user model to instantiate a CreationForm instead. The implementation can now have any fields it wants as long as it's compatible with Django's AbstractUser.

Fixes #234

By default, Django will use its own default User model when
initializing the CreationForm.

This will cause FieldErrors to be raised when a customer user model
is provided but doesn't contain the same fields as in Django's default
implementation.

That's why we use the custom user model to instantiate a CreationForm
instead. The implementation can now have any fields it wants as long as
it's compatible with Django's AbstractUser.

Fixes ubernostrum#234
@ubernostrum
Copy link
Owner

I'm going to close this for now because, as noted on #234, I plan to do a major version bump which will completely remove django-registration's dependency on UserCreationForm. So this will get fixed via the eventual django-registration 4.0 release, but in a different way than what this PR is doing.

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

Successfully merging this pull request may close these issues.

Error importing RegistrationView when using custom user model with unique USERNAME_FIELD
2 participants