From 6ec867f27565fb53b7b76419d4d9bc0f10c9893c Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 17 Mar 2015 14:06:43 +0100 Subject: [PATCH] i-use: Allow going back in time for the i-use images as well --- webapp/handlers_iuse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/handlers_iuse.py b/webapp/handlers_iuse.py index 5b3af7f2..fe7f26ed 100644 --- a/webapp/handlers_iuse.py +++ b/webapp/handlers_iuse.py @@ -32,9 +32,14 @@ class IUseImage(BaseHandler): def get(self, profile_id, image_id): image = None + + when = self.get_argument_date("when", None) + # Try to get the image from memcache. If we have a cache miss we # build a new one. mem_id = "iuse-%s-%s-%s" % (profile_id, image_id, self.locale.code) + if when: + mem_id += "-%s" % when.isoformat() cache = self.get_argument("cache", "true") if cache == "true": @@ -49,7 +54,7 @@ class IUseImage(BaseHandler): if not image_cls: raise tornado.web.HTTPError(404, "Image class is unknown: %s" % image_id) - profile = self.fireinfo.get_profile(profile_id) + profile = self.fireinfo.get_profile(profile_id, when=when) if not profile: raise tornado.web.HTTPError(404, "Profile '%s' was not found." % profile_id) -- 2.47.3