mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
bug fix
This commit is contained in:
parent
5d7aba72b5
commit
d844fb53dd
|
@ -37,6 +37,12 @@ class BaseAuthentication(object):
|
|||
"""
|
||||
All authentication classes should extend BaseAuthentication.
|
||||
"""
|
||||
def user_is_active(self, user):
|
||||
"""
|
||||
Returns True if user is active else returns False.
|
||||
Override this if some other field in custom user model determines user's activeness.
|
||||
"""
|
||||
return user.is_active
|
||||
|
||||
def authenticate(self, request):
|
||||
"""
|
||||
|
@ -85,13 +91,6 @@ class BasicAuthentication(BaseAuthentication):
|
|||
userid, password = auth_parts[0], auth_parts[2]
|
||||
return self.authenticate_credentials(userid, password)
|
||||
|
||||
def user_is_active(self, user):
|
||||
"""
|
||||
Returns True if user is active else returns False.
|
||||
Override this if some other field in custom user model determines user's activeness.
|
||||
"""
|
||||
return user.is_active
|
||||
|
||||
def authenticate_credentials(self, userid, password):
|
||||
"""
|
||||
Authenticate the userid and password against username and password.
|
||||
|
|
Loading…
Reference in New Issue
Block a user