For a `User` object `is_authenticated()` always returns True (its only useful for differentiating between `User` and `AnonymousUser` in templates). So this if statement will never evaluate to `True`. Just do `if not user.is_active:`.

https://github.com/django/django/blob/master/django/contrib/auth/models.py#L219-L224