mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 20:44:03 +03:00
Don't hit db to access user_id in TokenProxy (#7852)
This commit is contained in:
parent
67ebdd32cd
commit
b25ac6c5e3
|
@ -46,7 +46,7 @@ class TokenProxy(Token):
|
||||||
"""
|
"""
|
||||||
@property
|
@property
|
||||||
def pk(self):
|
def pk(self):
|
||||||
return self.user.pk
|
return self.user_id
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS
|
proxy = 'rest_framework.authtoken' in settings.INSTALLED_APPS
|
||||||
|
|
Loading…
Reference in New Issue
Block a user