Exactract "formCache' into form_cache.PARAM_NAME

This commit is contained in:
richard-dds
2018-11-19 11:46:21 -05:00
parent de12aee163
commit 1d5bfed556
3 changed files with 8 additions and 4 deletions

View File

@@ -7,11 +7,13 @@ DEFAULT_CACHE_NAME = "formcache"
class FormCache(object):
PARAM_NAME = "formCache"
def __init__(self, redis):
self.redis = redis
def from_request(self, http_request):
cache_key = http_request.args.get("formCache")
cache_key = http_request.args.get(self.PARAM_NAME)
if cache_key:
return self.read(cache_key)