diff options
| author | Xavier Ordoquy | 2014-04-13 00:05:57 +0200 | 
|---|---|---|
| committer | Xavier Ordoquy | 2014-04-13 00:05:57 +0200 | 
| commit | d08536ad9d026fb7126c430f6d9c18f8540aacd6 (patch) | |
| tree | a8a1d36ce76867e57da23379694ea0609801990b /rest_framework/throttling.py | |
| parent | 2911cd64ad67ba193e3d37322ee71692cb482623 (diff) | |
| parent | 93b9245b8714287a440023451ff7880a2f6e5b32 (diff) | |
| download | django-rest-framework-d08536ad9d026fb7126c430f6d9c18f8540aacd6.tar.bz2 | |
Merge remote-tracking branch 'origin/master' into 2.4.0
Conflicts:
	.travis.yml
	docs/api-guide/fields.md
	docs/api-guide/routers.md
	docs/topics/release-notes.md
	rest_framework/authentication.py
	rest_framework/serializers.py
	rest_framework/templatetags/rest_framework.py
	rest_framework/tests/test_authentication.py
	rest_framework/tests/test_filters.py
	rest_framework/tests/test_hyperlinkedserializers.py
	rest_framework/tests/test_serializer.py
	rest_framework/tests/test_testing.py
	rest_framework/utils/encoders.py
	tox.ini
Diffstat (limited to 'rest_framework/throttling.py')
| -rw-r--r-- | rest_framework/throttling.py | 2 | 
1 files changed, 2 insertions, 0 deletions
| diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index c40f3065..fc24c92e 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -155,6 +155,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) | 
