fix in session stopper error display

This commit is contained in:
Rushabh Mehta 2012-02-28 12:17:08 +01:00
parent bef8b86331
commit da27db4c7d

View File

@ -38,10 +38,25 @@ def init():
# init request # init request
try: try:
webnotes.http_request = webnotes.auth.HTTPRequest() webnotes.http_request = webnotes.auth.HTTPRequest()
return True
except webnotes.AuthenticationError, e: except webnotes.AuthenticationError, e:
pass pass
except webnotes.UnknownDomainError, e: except webnotes.UnknownDomainError, e:
print "Location: " + (webnotes.defs.redirect_404) print "Location: " + (webnotes.defs.redirect_404)
except webnotes.SessionStopped, e:
if 'cmd' in webnotes.form_dict:
webnotes.handler.print_json()
else:
print "Content-Type: text/html"
print
print """<html>
<body style="background-color: #EEE;">
<h3 style="width: 900px; background-color: #FFF; border: 2px solid #AAA; padding: 20px; font-family: Arial; margin: 20px auto">
Updating.
We will be back in a few moments...
</h3>
</body>
</html>"""
def respond(): def respond():
import webnotes import webnotes
@ -55,5 +70,5 @@ def respond():
print webnotes.cms.index.get() print webnotes.cms.index.get()
if __name__=="__main__": if __name__=="__main__":
init() if init():
respond() respond()