web/application.py
changeset 10777 eabacd3c6f16
parent 10744 c5dc40988e6e
child 10820 fef0ab4c4f94
equal deleted inserted replaced
10776:b1834143fec8 10777:eabacd3c6f16
   498             status = ex.status
   498             status = ex.status
   499         if req.status_out < 400:
   499         if req.status_out < 400:
   500             # don't overwrite it if it's already set
   500             # don't overwrite it if it's already set
   501             req.status_out = status
   501             req.status_out = status
   502         json_dumper = getattr(ex, 'dumps', lambda : json.dumps({'reason': text_type(ex)}))
   502         json_dumper = getattr(ex, 'dumps', lambda : json.dumps({'reason': text_type(ex)}))
   503         return json_dumper()
   503         return json_dumper().encode('utf-8')
   504 
   504 
   505     # special case handling
   505     # special case handling
   506 
   506 
   507     def need_login_content(self, req):
   507     def need_login_content(self, req):
   508         return self.vreg['views'].main_template(req, 'login')
   508         return self.vreg['views'].main_template(req, 'login')