From 90efafc783ecd0a83d4b27e36b9376368795ef22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 17 Nov 2018 15:52:47 +0100 Subject: [PATCH] misc: present self with a "portal-agent" slug in menu.json (#28105) --- combo/manager/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/combo/manager/views.py b/combo/manager/views.py index c4a44ed2..ff810c99 100644 --- a/combo/manager/views.py +++ b/combo/manager/views.py @@ -485,8 +485,16 @@ def menu_json(request): label = _('Editing "%(site_title)s"') % settings.TEMPLATE_VARS else: label = _('Content Management') + + slug = 'portal' + if getattr(settings, 'KNOWN_SERVICES') and 'combo' in settings.KNOWN_SERVICES: + # switch to custom slug if the site is the portal agent. + for service_slug, service in settings.KNOWN_SERVICES['combo'].items(): + if service.get('is-portal-agent') and not service.get('secret'): + slug = 'portal-agent' + json_str = json.dumps([{'label': force_text(label), - 'slug': 'portal', + 'slug': slug, 'url': request.build_absolute_uri(reverse('combo-manager-homepage')) }]) content_type = 'application/json' -- 2.19.1