From 3a8cd6af4308cd5537542b50f211215a06b12602 Mon Sep 17 00:00:00 2001 From: Brad Beattie Date: Fri, 9 Nov 2012 11:36:40 -0800 Subject: [PATCH] Always ensure the stamina attribute exists --- cache_throttle/decorators.py | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cache_throttle/decorators.py b/cache_throttle/decorators.py index b303b20..8a8df95 100644 --- a/cache_throttle/decorators.py +++ b/cache_throttle/decorators.py @@ -24,6 +24,7 @@ def decorator(fn): @wraps(fn) def _wrapped(request, *args, **kwargs): request.throttled = False + request.stamina = None try: interpreted_keys = [] for key in keys: diff --git a/setup.py b/setup.py index 95b4a28..d67aa8b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='django-cache-throttle', - version='2012.11.09.2', + version='2012.11.09.3', description='Cache-based rate-limiting for Django.', long_description='Uses Django\'s caching framework to provide a view decorator that rate limits through a regenerative stamina indicator.', author='Brad Beattie',