'Reject users with is_active=False. Custom user models that don\'t have
that attribute are allowed.'

def user_can_authenticate(self, user):

    is_active = getattr(user, 'is_active', None)
    return (is_active or (is_active is None))
