From e3abbabb23576d9192ac8f77e3f0145a7d1f46ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 26 Sep 2017 10:24:30 +0200 Subject: [PATCH] perfs: avoid events/links in critical path (#18965) --- auquotidien/modules/root.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/auquotidien/modules/root.py b/auquotidien/modules/root.py index da39a6d..3af7f45 100644 --- a/auquotidien/modules/root.py +++ b/auquotidien/modules/root.py @@ -808,8 +808,10 @@ class AlternateRootDirectory(OldRootDirectory): response.filter = {} response.filter['auquotidien'] = True - response.filter['gauche'] = self.box_side(path) - response.filter['keywords'] = template.get_current_theme().get('keywords') + if not path or path[0] not in ('api', 'backoffice'): + # api & backoffice have no use for a side box + response.filter['gauche'] = self.box_side(path) + response.filter['keywords'] = template.get_current_theme().get('keywords') get_publisher().substitutions.feed(self) response.breadcrumb = [ ('', _('Home')) ] @@ -1103,7 +1105,8 @@ class AlternateRootDirectory(OldRootDirectory): r += htmltext('') % _('Load') r += htmltext('') - r += self.links() + if get_cfg('aq-permissions', {}).get('links'): + r += self.links() cats = Category.select(order_by = 'name') cats = [x for x in cats if x.url_name != 'consultations' and x.get_homepage_position() == 'side'] @@ -1117,7 +1120,8 @@ class AlternateRootDirectory(OldRootDirectory): r += htmltext('') r += htmltext('') - if Event.keys(): # if there are events, add a link to the agenda + if get_cfg('aq-permissions', {}).get('events') and Event.keys(): + # if there are events, add a link to the agenda tags = get_cfg('misc', {}).get('event_tags') if not tags: tags = get_default_event_tags() -- 2.14.1