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',
|
||||
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>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user