Update custom 503 page code to be less...idiotic
This commit is contained in:
+3
-3
@@ -390,9 +390,9 @@ def wsgibase(environ, responder):
|
|||||||
% 'invalid request',
|
% 'invalid request',
|
||||||
web2py_error='invalid application')
|
web2py_error='invalid application')
|
||||||
elif not request.is_local and exists(disabled):
|
elif not request.is_local and exists(disabled):
|
||||||
if os.path.exists(os.path.join(request.folder,'static','503.html')):
|
five0three = os.path.join(request.folder,'static','503.html')
|
||||||
import urllib
|
if os.path.exists(five0three):
|
||||||
raise HTTP(503, urllib.urlopen(os.path.join(request.folder,'static','503.html')).read())
|
raise HTTP(503, file(five0three, 'r').read())
|
||||||
else:
|
else:
|
||||||
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user