# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1235090886 -3600 # Node ID 75488a2a875ec3e9ff837f89cf79d99cfe545610 # Parent 18e6c8db7bc544029b551120757a01c05338ce7c fix ui.main-template property handling diff -r 18e6c8db7bc5 -r 75488a2a875e web/application.py --- a/web/application.py Fri Feb 20 01:47:43 2009 +0100 +++ b/web/application.py Fri Feb 20 01:48:06 2009 +0100 @@ -385,7 +385,8 @@ req.data['excinfo'] = excinfo req.form['vid'] = 'error' errview = self.vreg.select_view('error', req, None) - content = self.vreg.main_template(req, 'main-template', view=errview) + template = self.main_template_id(req) + content = self.vreg.main_template(req, template, view=errview) except: content = self.vreg.main_template(req, 'error-template') raise StatusResponse(500, content) @@ -397,11 +398,17 @@ return self.vreg.main_template(req, 'loggedout') def notfound_content(self, req): - template = req.property_value('ui.main-template') or 'main-template' req.form['vid'] = '404' view = self.vreg.select_view('404', req, None) + template = self.main_template_id(req) return self.vreg.main_template(req, template, view=view) + def main_template_id(self, req): + template = req.property_value('ui.main-template') + if template not in self.vreg.registry('views') : + template = 'main-template' + return template + set_log_methods(CubicWebPublisher, LOGGER) set_log_methods(CookieSessionHandler, LOGGER) diff -r 18e6c8db7bc5 -r 75488a2a875e web/views/basecontrollers.py --- a/web/views/basecontrollers.py Fri Feb 20 01:47:43 2009 +0100 +++ b/web/views/basecontrollers.py Fri Feb 20 01:48:06 2009 +0100 @@ -66,9 +66,7 @@ view, rset = self._select_view_and_rset(rset) self.add_to_breadcrumbs(view) self.validate_cache(view) - template = self.req.property_value('ui.main-template') - if template not in self.vreg.registry('views') : - template = self.template + template = self.appli.main_template_id(self.req) return self.vreg.main_template(self.req, template, rset=rset, view=view) def _select_view_and_rset(self, rset):