diff options
Diffstat (limited to 'rest_framework/authentication.py')
| -rw-r--r-- | rest_framework/authentication.py | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index 4832ad33..f7601fb1 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -167,7 +167,7 @@ class TokenAuthentication(BaseAuthentication):      def authenticate_credentials(self, key):          try: -            token = self.model.objects.get(key=key) +            token = self.model.objects.select_related('user').get(key=key)          except self.model.DoesNotExist:              raise exceptions.AuthenticationFailed('Invalid token') | 
