MCPcopy
hub / github.com/django/django / user_can_authenticate

Method user_can_authenticate

django/contrib/auth/backends.py:96–101  ·  view source on GitHub ↗

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

(self, user)

Source from the content-addressed store, hash-verified

94 return user
95
96 def user_can_authenticate(self, user):
97 """
98 Reject users with is_active=False. Custom user models that don't have
99 that attribute are allowed.
100 """
101 return getattr(user, "is_active", True)
102
103 def _get_user_permissions(self, user_obj):
104 return user_obj.user_permissions.all()

Callers 6

authenticateMethod · 0.95
aauthenticateMethod · 0.95
get_userMethod · 0.95
aget_userMethod · 0.95
authenticateMethod · 0.45
aauthenticateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected