From f7dde4c01fe9bc713a156e46e8a1d1940eed7c2a Mon Sep 17 00:00:00 2001 From: Guglielmo Date: Sun, 2 Nov 2014 19:07:31 +0100 Subject: [PATCH] 0 value added to cache key, instead of '0'; avoids error when incrementing the value --- mapit/ratelimitcache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapit/ratelimitcache.py b/mapit/ratelimitcache.py index 7bedf6e9..73aa05c5 100644 --- a/mapit/ratelimitcache.py +++ b/mapit/ratelimitcache.py @@ -58,7 +58,7 @@ def cache_incr(self, key): try: cache.incr(key) except ValueError: - cache.add(key, '0', self.expire_after()) + cache.add(key, 0, self.expire_after()) cache.incr(key) def should_ratelimit(self, request):