Skip to content

Commit b25ac6c

Browse files
authored
Don't hit db to access user_id in TokenProxy (encode#7852)
1 parent 67ebdd3 commit b25ac6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/authtoken/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TokenProxy(Token):
4646
"""
4747
@property
4848
def pk(self):
49-
return self.user.pk
49+
return self.user_id
5050

5151
class Meta:
5252
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS

0 commit comments

Comments
 (0)