misc: remove link to FranceConnect screen if there's no authentic (#34209)

This commit is contained in:
Frédéric Péters 2019-06-21 10:28:34 +02:00
parent 20018fbac8
commit a5836a35b6
2 changed files with 3 additions and 0 deletions

View File

@ -9,7 +9,9 @@
<li><a href="{% url 'profile-home' %}">{% trans 'User Profile' %}</a></li>
<li><a href="{% url 'theme-home' %}">{% trans 'Theme' %}</a></li>
<li><a href="{% url 'emails-home' %}">{% trans 'Emails' %}</a></li>
{% if has_authentic %}
<li><a href="{% url 'franceconnect-home' %}">FranceConnect</a></li>
{% endif %}
<li><a href="{% url 'matomo-home' %}">{% trans 'User tracking' %}</a></li>
<li><a href="{% url 'environment-home' %}">{% trans 'Services' %}</a></li>
<li><a href="{% url 'environment-variables' %}">{% trans 'Variables' %}</a></li>

View File

@ -33,6 +33,7 @@ class Home(TemplateView):
def get_context_data(self, **kwargs):
context = super(Home, self).get_context_data(**kwargs)
context['services'] = [x for x in get_installed_services() if not x.secondary]
context['has_authentic'] = bool(Authentic.objects.filter(secondary=False))
return context
home = admin_required(Home.as_view())