Skip to content

Commit

Permalink
style: Fix various pylint violations.
Browse files Browse the repository at this point in the history
  • Loading branch information
feanil committed May 23, 2023
1 parent 84bff07 commit 5db7542
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edx_rest_framework_extensions/auth/jwt/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from rest_framework import exceptions
from rest_framework_jwt.authentication import JSONWebTokenAuthentication

from edx_rest_framework_extensions.auth.jwt.cookies import jwt_cookie_name
from edx_rest_framework_extensions.auth.jwt.constants import USE_JWT_COOKIE_HEADER
from edx_rest_framework_extensions.auth.jwt.cookies import jwt_cookie_name
from edx_rest_framework_extensions.auth.jwt.decoder import configured_jwt_decode_handler
from edx_rest_framework_extensions.config import ENABLE_FORGIVING_JWT_COOKIES
from edx_rest_framework_extensions.settings import get_setting
Expand Down
6 changes: 5 additions & 1 deletion edx_rest_framework_extensions/auth/jwt/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
jwt_cookie_name,
jwt_cookie_signature_name,
)
from edx_rest_framework_extensions.config import ENABLE_FORGIVING_JWT_COOKIES, ENABLE_SET_REQUEST_USER_FOR_JWT_COOKIE
from edx_rest_framework_extensions.config import (
ENABLE_FORGIVING_JWT_COOKIES,
ENABLE_SET_REQUEST_USER_FOR_JWT_COOKIE,
)
from edx_rest_framework_extensions.permissions import (
LoginRedirectIfUnauthenticated,
NotJwtRestrictedApplication,
Expand Down Expand Up @@ -305,6 +308,7 @@ def _process_view_forgiving_jwt_cookies(self, request, view_func):
# For more info, see https://github.com/jpadilla/django-rest-framework-jwt/issues/45#issuecomment-74996698
request.user = SimpleLazyObject(lambda: _get_user_from_jwt(request, view_func))


def _get_user_from_jwt(request, view_func):
user = get_user(request)
if user.is_authenticated:
Expand Down
1 change: 0 additions & 1 deletion edx_rest_framework_extensions/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from edx_django_utils.cache import DEFAULT_REQUEST_CACHE

import edx_rest_framework_extensions
from edx_rest_framework_extensions.auth.jwt.constants import USE_JWT_COOKIE_HEADER
from edx_rest_framework_extensions.auth.jwt.cookies import jwt_cookie_name


Expand Down

0 comments on commit 5db7542

Please sign in to comment.