mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-03 15:04:08 +03:00
implemented testing of per user throttling
This commit is contained in:
parent
63d086ea11
commit
8ef333a29f
|
@ -105,7 +105,7 @@ class PerUserThrottling(BasePermission):
|
||||||
(num_requests, duration) = getattr(self.view, 'throttle', (0, 0))
|
(num_requests, duration) = getattr(self.view, 'throttle', (0, 0))
|
||||||
|
|
||||||
if user.is_authenticated():
|
if user.is_authenticated():
|
||||||
ident = str(auth)
|
ident = str(user)
|
||||||
else:
|
else:
|
||||||
ident = self.view.request.META.get('REMOTE_ADDR', None)
|
ident = self.view.request.META.get('REMOTE_ADDR', None)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user