Fair enough, I guess subclassing it makes more sense, I saw that it uses
`USERNAME_FIELD`[1] so I assumed it could use the custom model by default
too, but I guess you can have completely different models and that could
create some confusion.

Anyway, sorry to take you time and thanks for quick response,
Cheers!

1:
https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L92


On 22 February 2017 at 17:05, Davor Lučić <r.dav...@gmail.com> wrote:

> Hello,
>
> I have issues using custom user model and forms from contrib.auth.forms
> When 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
> https://github.com/django/django/blob/master/django/
> contrib/auth/forms.py#L86
>
> 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+unsubscr...@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/CAKB_9CLCd_PF-XNGnQUvU%2B%3D5pPYJgNWBFL82tk4EpuZvLB03zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to