]> git.ipfire.org Git - ipfire.org.git/commitdiff
i-use: Fix sending error images.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Mar 2014 18:40:36 +0000 (19:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Mar 2014 18:40:36 +0000 (19:40 +0100)
The error handling has changed in a recent version of
Tornado and our code has not been adapted accordingly.

webapp/handlers_iuse.py

index 4428afd8e19c2d7361ea7d99d022d20bea09342d..13085c986dd8137040baafc999c15a19e3f3dba0 100644 (file)
@@ -9,7 +9,7 @@ from handlers_base import *
 import backend
 
 class IUseImage(BaseHandler):
-       def get_error_html(self, status_code, **kwargs):
+       def write_error(self, status_code, **kwargs):
                """
                        Select a random image from the errors directory
                        and return the content.
@@ -24,8 +24,11 @@ class IUseImage(BaseHandler):
                        image = random.choice(images)
                        image = os.path.join(template_path, image)
 
+                       imgdata = None
                        with open(image, "rb") as f:
-                               return f.read()
+                               imgdata = f.read()
+
+                       self.finish(imgdata)
 
        def get(self, profile_id, image_id):
                image = None