Fix svg parsing in mod_wsgi
authorSimo Sorce <simo@redhat.com>
Wed, 12 Nov 2014 20:20:14 +0000 (15:20 -0500)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Wed, 12 Nov 2014 22:48:11 +0000 (23:48 +0100)
Whe ipsilon is used behind apache we need to cast the template to a string.
Otherwise mod_wsgi returns a TypeError complaining about the fact data is
a unicode string instead of a byte string.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/admin/common.py

index 2b83314..5927306 100755 (executable)
@@ -331,5 +331,5 @@ class Admin(AdminPage):
         cherrypy.response.headers.update({'Content-Type': 'image/svg+xml'})
         urls = self.get_menu_urls()
         # pylint: disable=star-args
-        return self._template('admin/ipsilon-scheme.svg', **urls)
+        return str(self._template('admin/ipsilon-scheme.svg', **urls))
     scheme.public_function = True