Skip to content

Commit

Permalink
Cleaned backend get_user method
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Feb 3, 2020
1 parent b35703b commit 568a3d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions graphql_jwt/backends.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .shortcuts import get_user_by_token
from .utils import get_credentials, get_user_by_natural_key
from .utils import get_credentials


class JSONWebTokenBackend:
Expand All @@ -16,4 +16,4 @@ def authenticate(self, request=None, **kwargs):
return None

def get_user(self, user_id):
return get_user_by_natural_key(user_id)
return None
4 changes: 2 additions & 2 deletions tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def test_authenticate_missing_token(self):
self.assertIsNone(user)

def test_get_user(self):
user = self.backend.get_user(self.user.get_username())
self.assertEqual(user, self.user)
user = self.backend.get_user(self.user.pk)
self.assertIsNone(user)

0 comments on commit 568a3d2

Please sign in to comment.