From 8ef333a29f1981b1ca4fa060998863285f408019 Mon Sep 17 00:00:00 2001 From: markotibold Date: Sat, 11 Jun 2011 01:48:10 +0200 Subject: [PATCH] implemented testing of per user throttling --- djangorestframework/permissions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/djangorestframework/permissions.py b/djangorestframework/permissions.py index 1f6151f8c..a9b3f08b8 100644 --- a/djangorestframework/permissions.py +++ b/djangorestframework/permissions.py @@ -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)