﻿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
26823	auth signal receiver update_last_login not compatible with custom user models that have no last_login field	Harry Percival	nobody	"In my experiments with building a minimal custom user model, I've managed to build one that has just one field, email.  Which I think is brilliant of course.   One feature in the `auth` module is stopping it from working though, the `update_last_login` signal receiver from contrib.auth.models, which is wired up in `auth.signals.user_logged_in`.

My workaround is to do a

{{{
from django.contrib import auth
auth.signals.user_logged_in.disconnect(auth.models.update_last_login)
}}}

But we could make the signal handler more resilient.  Something like this?

{{{
def update_last_login(sender, user, **kwargs):
    if not hasattr(user, 'last_login'):
        return
}}}

PR to follow..."	Bug	closed	contrib.auth	1.9	Normal	fixed			Accepted	1	0	0	0	0	0
