mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 16:24:18 +03:00
[documentation] Throttling random request code example fix (#4451)
This commit is contained in:
parent
b683cd7afc
commit
80bd3b9722
|
@ -188,7 +188,7 @@ The following is an example of a rate throttle, that will randomly throttle 1 in
|
||||||
|
|
||||||
class RandomRateThrottle(throttling.BaseThrottle):
|
class RandomRateThrottle(throttling.BaseThrottle):
|
||||||
def allow_request(self, request, view):
|
def allow_request(self, request, view):
|
||||||
return random.randint(1, 10) == 1
|
return random.randint(1, 10) != 1
|
||||||
|
|
||||||
[cite]: https://dev.twitter.com/docs/error-codes-responses
|
[cite]: https://dev.twitter.com/docs/error-codes-responses
|
||||||
[permissions]: permissions.md
|
[permissions]: permissions.md
|
||||||
|
|
Loading…
Reference in New Issue
Block a user