aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/throttling.py
diff options
context:
space:
mode:
authorXavier Ordoquy2014-03-03 11:41:07 +0100
committerXavier Ordoquy2014-03-03 11:41:07 +0100
commit3d7cb72e0a770595d8934b731f9c462b839f941a (patch)
tree809035a13a8de89d020ffefea38f779bfa4a7ed3 /rest_framework/throttling.py
parentb2f0f4fcf49d457aefc21960f62fcb8f2cf6770d (diff)
parentee9864e0dce10018261c131a76eb7c668703d76c (diff)
downloaddjango-rest-framework-3d7cb72e0a770595d8934b731f9c462b839f941a.tar.bz2
Merge remote-tracking branch 'reference/master' into feature/django_1_7
Diffstat (limited to 'rest_framework/throttling.py')
-rw-r--r--rest_framework/throttling.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py
index a946d837..efa9fb94 100644
--- a/rest_framework/throttling.py
+++ b/rest_framework/throttling.py
@@ -136,6 +136,8 @@ class SimpleRateThrottle(BaseThrottle):
remaining_duration = self.duration
available_requests = self.num_requests - len(self.history) + 1
+ if available_requests <= 0:
+ return None
return remaining_duration / float(available_requests)