﻿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
3029	[patch] Erroneous values stored in contrib.auth fields: date_joined, last_login	Tim Goh	nobody	"Problem:

The date_joined and last_login fields in the contrib.auth package are both declared as ""default=models.LazyDate()"", which results in the following incorrect behavior:

 1. date_joined and last_login are updated to the current date/time whenever the User model is saved.
 1. last_login is updated when the user logs into the admin interface, but any application front-ends hooking on to contrib.auth  will have to update it themselves upon authenticating.  This is not what the name ""last_login"" implies.

Patch description:

(patched against r4077)

The attached patch defines date_joined and last_login as auto_now_add=True, so they are timestamped upon creation of the user object.  Subsequently, upon successful authentication, last_login is updated with the current time."	defect	closed	Contrib apps	dev	normal	fixed		gary.wilson@…	Accepted	1	0	0	1	0	0
