From f8d62423e5b29a25d4d5541cabb1759e3fc16e12 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Mon, 10 Oct 2016 20:53:21 -0700 Subject: [PATCH] Update custom 503 page code to be less...idiotic --- gluon/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gluon/main.py b/gluon/main.py index 2c887c1c..97b49c9a 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -390,9 +390,9 @@ def wsgibase(environ, responder): % 'invalid request', web2py_error='invalid application') elif not request.is_local and exists(disabled): - if os.path.exists(os.path.join(request.folder,'static','503.html')): - import urllib - raise HTTP(503, urllib.urlopen(os.path.join(request.folder,'static','503.html')).read()) + five0three = os.path.join(request.folder,'static','503.html') + if os.path.exists(five0three): + raise HTTP(503, file(five0three, 'r').read()) else: raise HTTP(503, "

Temporarily down for maintenance

")