From 21388e55f75f9c0ccc96712ae07118f32b794273 Mon Sep 17 00:00:00 2001 From: Steven Pollack Date: Tue, 29 Mar 2016 02:28:21 +0200 Subject: [PATCH] caught json hydration bug - need to append .decode to redis fetches - need to use location_json.timeZoneId when calculation timeUntilTomorrow --- locache/root.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locache/root.py b/locache/root.py index d837698..f413f34 100644 --- a/locache/root.py +++ b/locache/root.py @@ -54,8 +54,8 @@ def query_cache(self): warnings.warn("Retrieved result cached at key: %s" % self.cache_key) # add timeUntilTomorrow to location_json before dehydration - location_json = json.loads(cached_location) - location_json['timeUntilTomorrow'] = time_until_next(0, 0, 0, self.Location.tz_id) + location_json = json.loads(cached_location.decode()) + location_json['timeUntilTomorrow'] = time_until_next(0, 0, 0, location_json['timeZoneId']) self.response = Response(json.dumps(location_json), status=200, mimetype=self.mimetype) return self.response else: