﻿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
27524	Using user instance (instead of get_user_model()) leads to errors when user model is overridden	Andy Martin	nobody	"We've been seeing errors like this on 1.8.16:

{{{
File ""[...snip...]/django/contrib/auth/__init__.py"", line 111, in login
    request.session[SESSION_KEY] = user._meta.pk.value_to_string(user)
AttributeError: 'MetaDict' object has no attribute 'pk'
}}}

We solved them by going through the object returned by get_user_model() instead of using the user instance directly. This also matches what's done in other parts of the codebase (for example, in _get_user_session_key(request))."	Bug	closed	contrib.auth	1.8	Normal	wontfix			Unreviewed	1	0	1	0	0	0
