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