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

Commit 8e08e1a

Browse files
committed
Merge pull request #152 from oasiswork/fix-custom-model-appregistrynotready
Only get_user_model at runtime, avoiding AppRegistryNotReady error w. custom models
2 parents c4f529d + bf3f94f commit 8e08e1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework_jwt/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from rest_framework_jwt.settings import api_settings
1111

1212

13-
User = get_user_model()
1413
jwt_decode_handler = api_settings.JWT_DECODE_HANDLER
1514
jwt_get_username_from_payload = api_settings.JWT_PAYLOAD_GET_USERNAME_HANDLER
1615

@@ -48,6 +47,7 @@ def authenticate_credentials(self, payload):
4847
"""
4948
Returns an active user that matches the payload's user id and email.
5049
"""
50+
User = get_user_model()
5151
username = jwt_get_username_from_payload(payload)
5252

5353
if not username:

0 commit comments

Comments
 (0)