]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
i-use: Allow going back in time for the i-use images as well
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Mar 2015 13:06:43 +0000 (14:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 17 Mar 2015 13:06:43 +0000 (14:06 +0100)
webapp/handlers_iuse.py

index 5b3af7f25e3efd0ffaa0ae05db84b2918b3c1017..fe7f26ed278d446981d54e7b166447ad6b2c63e3 100644 (file)
@@ -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)