Projet

Général

Profil

0001-misc-present-self-with-a-portal-agent-slug-in-menu.j.patch

Frédéric Péters, 17 novembre 2018 15:54

Télécharger (1,28 ko)

Voir les différences:

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(-)
combo/manager/views.py
485 485
        label = _('Editing "%(site_title)s"') % settings.TEMPLATE_VARS
486 486
    else:
487 487
        label = _('Content Management')
488

  
489
    slug = 'portal'
490
    if getattr(settings, 'KNOWN_SERVICES') and 'combo' in settings.KNOWN_SERVICES:
491
        # switch to custom slug if the site is the portal agent.
492
        for service_slug, service in settings.KNOWN_SERVICES['combo'].items():
493
            if service.get('is-portal-agent') and not service.get('secret'):
494
                slug = 'portal-agent'
495

  
488 496
    json_str = json.dumps([{'label': force_text(label),
489
        'slug': 'portal',
497
        'slug': slug,
490 498
        'url': request.build_absolute_uri(reverse('combo-manager-homepage'))
491 499
        }])
492 500
    content_type = 'application/json'
493
-