Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Sep 19, 2022
1 parent f1839a1 commit 96e35fe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion core/common/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def get_auth_class(self, request):
if AuthService.is_valid_django_token(request):
klass = TokenAuthentication
else:
from core.common.services import AuthService
klass = AuthService.get().authentication_class

return klass()
Expand Down
4 changes: 2 additions & 2 deletions core/common/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ def get_auth_backend(self, request=None):
if AuthService.is_valid_django_token(request):
klass = ModelBackend
else:
from core.common.services import AuthService
klass = AuthService.get().authentication_backend_class

self._authentication_backend = klass()

return self._authentication_backend

def authenticate(self, request, username=None, password=None, **kwargs):
return self.get_auth_backend(request).authenticate(request=request, username=username, password=password, **kwargs)
return self.get_auth_backend(request).authenticate(
request=request, username=username, password=password, **kwargs)

def get_user(self, user_id):
return self.get_auth_backend().get_user(user_id=user_id)
1 change: 0 additions & 1 deletion core/middlewares/middlewares.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import time

from request_logging.middleware import LoggingMiddleware
from rest_framework.authtoken.models import Token

from core.common.constants import VERSION_HEADER, REQUEST_USER_HEADER, RESPONSE_TIME_HEADER, REQUEST_URL_HEADER, \
REQUEST_METHOD_HEADER
Expand Down

0 comments on commit 96e35fe

Please sign in to comment.