From 6c79071a755881a5912fe0bae37160b2c9735525 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 19 Jul 2013 20:15:06 +0200 Subject: try to fix bug when refreshing page --- pyload/web/pyload_app.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'pyload') diff --git a/pyload/web/pyload_app.py b/pyload/web/pyload_app.py index 2f6211621..7202c319b 100644 --- a/pyload/web/pyload_app.py +++ b/pyload/web/pyload_app.py @@ -49,11 +49,14 @@ def index(): # TODO show different page pass - f = server_static('index.html') - content = f.body.read() - f.body = template(content, ws=PYLOAD.getWSAddress(), web=PYLOAD.getConfigValue('webinterface', 'port')) + resp = server_static('index.html') - return f + # Render variables into the html page + if resp.status_code == 200: + content = resp.body.read() + resp.body = template(content, ws=PYLOAD.getWSAddress(), web=PYLOAD.getConfigValue('webinterface', 'port')) + + return resp # Very last route that is registered, could match all uris @route('/') -- cgit v1.2.3