django/django — pull request #1053 by makto (2013-05-11 08:08:28+00:00)
Title: Fix #20394, parameter user_id of the custom get_user has to be the pk of User

The original statement "which could be ... or whatever" **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.