﻿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
22192	PasswordResetForm fails on custom user models without an is_active DB field	Fraser Nevett	nobody	"The change made for ticket #21291 results in the standard `PasswordResetForm` breaking if the custom user model being used doesn't have `is_active` defined as a database field. It raises:

  `Cannot resolve keyword 'is_active' into field.`

As far as I can tell from the docs and code, Django requires `is_active` to be present on the custom user model as an '''attribute''', not an actual database field.

In my case, I have `is_active` defined as a property on the model that is calculated from other information.

The filtering of active users should therefore be done in Python rather than at the database-level. Instead of:

{{{#!python
active_users = UserModel._default_manager.filter(
    email__iexact=email, is_active=True)
for user in active_users:
}}}

It should be something like:

{{{#!python
users = UserModel._default_manager.filter(email__iexact=email)
active_users = filter(lambda u: u.is_active, users)
for user in active_users:
}}}"	Bug	closed	contrib.auth	1.6	Normal	invalid			Unreviewed	0	0	0	0	0	0
