Opened 5 years ago

Closed 5 years ago

#24494 closed Uncategorized (duplicate)

Inconsistency in Documentation between Custom Authentication Backends and Custom Users

Reported by: Alex Rothberg Owned by: nobody
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The docs for writing an authentication backend state:

The get_user method takes a user_id – which could be a username, database ID or whatever, but has to be the primary key of your User object – and returns a User object.

whereas the docs for writing a custom user state:

Django expects your custom User model to meet some minimum requirements.
Your model must have an integer primary key.

I would expect that username need not be an integer but that seems to be disallowed by the user model spec.

Change History (1)

comment:1 Changed 5 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

Duplicate of #24429

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