diff --git a/rest_framework_digestauth/authentication.py b/rest_framework_digestauth/authentication.py index 2a7b3c7..f0f1fd4 100644 --- a/rest_framework_digestauth/authentication.py +++ b/rest_framework_digestauth/authentication.py @@ -13,8 +13,6 @@ from rest_framework_digestauth.utils import parse_dict_header -User = get_user_model() - backend_path = getattr( settings, 'DIGESTAUTH_BACKEND', @@ -104,6 +102,7 @@ def check_authorization_request_header(self): raise exceptions.ParseError('%s provided without qop' % c) def get_user(self): + User = get_user_model() username = self.auth_header['username'] try: username_field = 'username'