Commit 80bd3b97 by Jakub Moliński Committed by Tom Christie

[documentation] Throttling random request code example fix (#4451)

parent b683cd7a
...@@ -188,7 +188,7 @@ The following is an example of a rate throttle, that will randomly throttle 1 in ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment