The documentation says you need to rewrite UserCreationForm for a custom user model: https://docs.djangoproject.com/en/stable/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms.
On Wednesday, February 22, 2017 at 11:06:14 AM UTC-5, rebus wrote:
-- On Wednesday, February 22, 2017 at 11:06:14 AM UTC-5, rebus wrote:
Hello,I have issues using custom user model and forms from contrib.auth.formsWhen using `UserCreationForm` it says `auth_user table does not exists` which is expected since i have different user model.Looking at the code, some pieces of code use `get_user_model` and `UserModel` while model forms use `User` imported from `auth.models`.For example:https://github.com/django/django/blob/master/django/ contrib/auth/forms.py#L10 If i use UserModel there it seems to work fine. Would this be considered a bug?Just wanted to check before creating a ticket.Thank you,Davor
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/26176582-7591-4882-9c9e-bc44d91fae5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment