mirror of https://github.com/django/django.git
Refs #25232 -- Simplified ModelBackend.user_can_authenticate().
Thanks Jay Turner for the suggestion.
This commit is contained in:
parent
f8f16b3cd8
commit
282d58e193
|
@ -57,8 +57,7 @@ class ModelBackend(BaseBackend):
|
||||||
Reject users with is_active=False. Custom user models that don't have
|
Reject users with is_active=False. Custom user models that don't have
|
||||||
that attribute are allowed.
|
that attribute are allowed.
|
||||||
"""
|
"""
|
||||||
is_active = getattr(user, "is_active", None)
|
return getattr(user, "is_active", True)
|
||||||
return is_active or is_active is None
|
|
||||||
|
|
||||||
def _get_user_permissions(self, user_obj):
|
def _get_user_permissions(self, user_obj):
|
||||||
return user_obj.user_permissions.all()
|
return user_obj.user_permissions.all()
|
||||||
|
|
Loading…
Reference in New Issue