﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20394	parameter ``user_id`` of the custom ``get_user`` method has to be the pk of User	zhongqi90@…	nobody	"parameter `user_id` of the custom `get_user` method has to be the pk of User, while the documentation's statement is quite misleading.

The original documentation says ""The get_user method takes a user_id – which could be a username, database ID or whatever – and returns a User object."" [https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#writing-an-authentication-backend]

It **misguides** many newbies like me.

In fact, the `login` function in `contrib.auth` stores `user.pk` in session, then `get_user` function in `contrib.auth` gets `user.pk` in session and then passes it to your custom `get_user` as `user_id`.

Which means, `user_id` parameter in your custom `get_user` has to be the primary key of `User` object, too."	Cleanup/optimization	closed	Documentation	1.5	Normal	fixed	misleading, ambiguous, authentication		Unreviewed	1	0	0	0	1	0
