]> git.ipfire.org Git - ipfire.org.git/blobdiff - webapp/handlers_iuse.py
i-use: Fix error images when the profile is disabled or not found
[ipfire.org.git] / webapp / handlers_iuse.py
index fe7f26ed278d446981d54e7b166447ad6b2c63e3..b93552451864924f7467f96bb5d2432c8f401ef4 100644 (file)
@@ -50,14 +50,14 @@ class IUseImage(BaseHandler):
                else:
                        logging.info("Rendering new image for profile: %s" % profile_id)
 
+                       profile = self.fireinfo.get_profile_with_data(profile_id, when=when)
+                       if not profile:
+                               raise tornado.web.HTTPError(404, "Profile '%s' was not found." % profile_id)
+
                        image_cls = self.iuse.get_imagetype(image_id)
                        if not image_cls:
                                raise tornado.web.HTTPError(404, "Image class is unknown: %s" % image_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)
-
                        # Render the image
                        image = image_cls(self.backend, self, profile).to_string()
 
@@ -66,4 +66,3 @@ class IUseImage(BaseHandler):
 
                self.set_header("Content-Type", "image/png")
                self.write(image)
-