Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22575 closed Uncategorized (fixed)

auth.User model doesn't exist

Reported by: adminq80@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords: auth.User
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Hello all, I was trying to follow the documentation and importing User from auth module but it didn't work, so I used auth.get_user_model() instead. Would you update the documentation accordingly, please?

The documentation link that has the error is https://docs.djangoproject.com/en/1.6/topics/class-based-views/generic-editing/

I am using Django version 1.6.4 final

Sincerely,
Abdul

Attachments (1)

generic-editing.txt (8.9 KB ) - added by adminq80@… 10 years ago.
I modifyed line 183 and line 188 from User to get_user_model

Download all attachments as: .zip

Change History (10)

by adminq80@…, 10 years ago

Attachment: generic-editing.txt added

I modifyed line 183 and line 188 from User to get_user_model

comment:1 by abdul, 10 years ago

The documentation is now updated.

Sincerely,
Abdul

comment:2 by anonymous, 10 years ago

Resolution: fixed
Status: newclosed

comment:3 by Aymeric Augustin, 10 years ago

Resolution: fixedinvalid
  • Importing the User model certainly works; if you run into trouble, please see TicketClosingReasons/UseSupportChannels for ways to get help.
  • Using get_user_model() in a ForeignKey declaration is wrong and will raise an exception in Django 1.7; if you want to support custom user models, the proper idiom is ForeignKey(settings.AUTH_USER_MODEL)
  • The change proposed above wasn't committed, so the ticket should have stayed open until someone had either committed the change or rejected the ticket — which I'm doing now.

comment:4 by abdul, 10 years ago

I am using Django 1.6.4 and I tried from django.contrib.auth import User and it didn't work for me. I propose to modify the importing path to look like from django.contrib.auth.models import User.

Sincerely,
Abdul

comment:5 by Aymeric Augustin, 10 years ago

Resolution: invalid
Status: closednew
Triage Stage: UnreviewedAccepted

Oh, yeah, there's a typo in the import line. I was misled by the suggestion to switch to get_user_model().

comment:6 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 87776859affc45b9b485d8377c046dd464aaeef4:

Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

comment:7 by Tim Graham <timograham@…>, 10 years ago

In 6a6f294f518a96334c73b2e5f934cdd2f0feda7e:

[1.7.x] Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

Backport of 87776859af from master

comment:8 by Tim Graham <timograham@…>, 10 years ago

In cddbaca6976a1e6faba8e846b87e27b35e268198:

[1.6.x] Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

Backport of 87776859af from master

comment:9 by Tim Graham <timograham@…>, 10 years ago

In 41ab97b6a4e785a35b6199134aad39091b6b1aab:

[1.5.x] Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

Backport of 87776859af from master

Note: See TracTickets for help on using tickets.
Back to Top