[minor] [patching] Show a nice message when system is upgrading webnotes/wnframework#178

This commit is contained in:
Rushabh Mehta 2013-08-13 10:26:22 +05:30
parent 82fdc98091
commit 78f083da7a

View file

@ -20,6 +20,20 @@ sys.path.append('../app')
import conf
session_stopped = """<!DOCTYPE html>
<html lang="en">
<head>
<title>Session Stopped</title>
</head>
<body style="background-color: #eee; font-family: Arial, Sans Serif;">
<div style="margin: 30px auto; width: 500px; background-color: #fff;
border: 1px solid #aaa; padding: 20px; text-align: center">
<b>Upgrading...</b>
<p>We will be back in a few moments.</p>
</div>
</body>
</html>"""
def init():
import webnotes.handler
webnotes.handler.get_cgi_fields()
@ -27,7 +41,12 @@ def init():
def respond():
import webnotes
import webnotes.webutils
return webnotes.webutils.render(webnotes.form_dict.get('page'))
try:
return webnotes.webutils.render(webnotes.form_dict.get('page'))
except webnotes.SessionStopped:
print "Content-type: text/html"
print
print session_stopped
if __name__=="__main__":
init()