From: Michael Tremer Date: Tue, 17 Mar 2015 13:06:43 +0000 (+0100) Subject: i-use: Allow going back in time for the i-use images as well X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ec867f27565fb53b7b76419d4d9bc0f10c9893c;p=ipfire.org.git i-use: Allow going back in time for the i-use images as well --- 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)