From c2dc7bc4925100d0baced0935c078316c06e053f Mon Sep 17 00:00:00 2001 From: Trey Long Date: Mon, 25 Jan 2016 19:42:29 -0500 Subject: [PATCH] Adding quick line to mangle keys This is an ugly line of code and I'm sure it's not a best practice. But this solves my error condition. --- flask_cache/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flask_cache/__init__.py b/flask_cache/__init__.py index 85d90e3..0ecdbc0 100644 --- a/flask_cache/__init__.py +++ b/flask_cache/__init__.py @@ -347,6 +347,9 @@ def _memoize_version(self, f, args=None, self.cache.delete_many(fetch_keys[-1]) return fname, None + # Mangle keys before using in the backend + fetch_keys = list(map(lambda k: hashlib.md5(k.encode()).hexdigest(), fetch_keys)) + version_data_list = list(self.cache.get_many(*fetch_keys)) dirty = False