web/application.py
branchtls-sprint
changeset 823 cb8ccbef8fa5
parent 661 4f61eb8a96b7
child 832 8e06873d80d3
equal deleted inserted replaced
822:e3d8db01f3f5 823:cb8ccbef8fa5
   382         try:
   382         try:
   383             req.data['ex'] = ex
   383             req.data['ex'] = ex
   384             if tb:
   384             if tb:
   385                 req.data['excinfo'] = excinfo
   385                 req.data['excinfo'] = excinfo
   386             req.form['vid'] = 'error'
   386             req.form['vid'] = 'error'
   387             content = self.vreg.main_template(req, 'main')
   387             errview = self.vreg.select_view('error', req, None)
       
   388             content = self.vreg.main_template(req, 'main-template', view=errview)
   388         except:
   389         except:
   389             content = self.vreg.main_template(req, 'error')
   390             content = self.vreg.main_template(req, 'error')
   390         raise StatusResponse(500, content)
   391         raise StatusResponse(500, content)
   391     
   392     
   392     def need_login_content(self, req):
   393     def need_login_content(self, req):
   394     
   395     
   395     def loggedout_content(self, req):
   396     def loggedout_content(self, req):
   396         return self.vreg.main_template(req, 'loggedout')
   397         return self.vreg.main_template(req, 'loggedout')
   397     
   398     
   398     def notfound_content(self, req):
   399     def notfound_content(self, req):
   399         template = req.property_value('ui.main-template') or 'main'
   400         template = req.property_value('ui.main-template') or 'main-template'
   400         req.form['vid'] = '404'
   401         req.form['vid'] = '404'
   401         return self.vreg.main_template(req, template)
   402         view404 = self.vreg.select_view('404', req, None)
       
   403         return self.vreg.main_template(req, template, view=view)
   402 
   404 
   403 
   405 
   404 set_log_methods(CubicWebPublisher, LOGGER)
   406 set_log_methods(CubicWebPublisher, LOGGER)
   405 set_log_methods(CookieSessionHandler, LOGGER)
   407 set_log_methods(CookieSessionHandler, LOGGER)