Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit e7605ec

Browse files
committed
Cleanup after pull request
1 parent ec43822 commit e7605ec

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

rest_framework_jwt/authentication.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from django.conf import settings
21
from rest_framework import exceptions
32
from rest_framework.authentication import (BaseAuthentication,
43
get_authorization_header)
@@ -8,10 +7,10 @@
87

98
try:
109
from django.contrib.auth import get_user_model
11-
except ImportError: # django < 1.5
12-
from django.contrib.auth.models import User as UserModel
10+
except ImportError: # Django < 1.5
11+
from django.contrib.auth.models import User
1312
else:
14-
UserModel = get_user_model()
13+
User = get_user_model()
1514

1615

1716
jwt_decode_handler = api_settings.DEFAULT_JWT_DECODE_HANDLER
@@ -66,8 +65,8 @@ def authenticate_credentials(self, user_id, email):
6665
Returns an active user that matches the payload's user id and email.
6766
"""
6867
try:
69-
user = UserModel.objects.get(pk=user_id, email=email, is_active=True)
70-
except UserModel.DoesNotExist:
68+
user = User.objects.get(pk=user_id, email=email, is_active=True)
69+
except User.DoesNotExist:
7170
msg = 'Invalid signature'
7271
raise exceptions.AuthenticationFailed(msg)
7372

0 commit comments

Comments
 (0)