Update custom 503 page code to be less...idiotic

This commit is contained in:
Vinyl Darkscratch
2016-10-10 20:53:21 -07:00
parent a28b1e30c9
commit f8d62423e5
+3 -3
View File
@@ -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, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")