Skip to content

Commit

Permalink
caught json hydration bug
Browse files Browse the repository at this point in the history
- need to append .decode to redis fetches
- need to use location_json.timeZoneId when calculation timeUntilTomorrow
  • Loading branch information
Steven Pollack committed Mar 29, 2016
1 parent 444e41c commit 21388e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locache/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 21388e5

Please sign in to comment.