From b475542c690ac2337614d746ee8119989974010b Mon Sep 17 00:00:00 2001
From: Paul Marillonnet <pmarillonnet@entrouvert.com>
Date: Fri, 2 Dec 2022 10:16:27 +0100
Subject: [PATCH] home: remove franceconnect menu entry (#71958)

---
 MANIFEST.in                                   |  1 -
 hobo/franceconnect/__init__.py                |  0
 .../templates/hobo/franceconnect_home.html    | 24 -------------------
 hobo/franceconnect/urls.py                    | 23 ------------------
 hobo/franceconnect/views.py                   | 24 -------------------
 hobo/settings.py                              |  1 -
 hobo/templates/hobo/home.html                 |  3 ---
 hobo/urls.py                                  |  2 --
 tests/test_home_views.py                      |  2 ++
 9 files changed, 2 insertions(+), 78 deletions(-)
 delete mode 100644 hobo/franceconnect/__init__.py
 delete mode 100644 hobo/franceconnect/templates/hobo/franceconnect_home.html
 delete mode 100644 hobo/franceconnect/urls.py
 delete mode 100644 hobo/franceconnect/views.py

diff --git a/MANIFEST.in b/MANIFEST.in
index 64177315..292a9af7 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,7 +2,6 @@ recursive-include hobo/static *.css *.scss *.png *.js *.svg
 recursive-include hobo/templates *.html *.txt
 recursive-include hobo/applications/templates *.html *.txt
 recursive-include hobo/debug/templates *.html *.txt
-recursive-include hobo/franceconnect/templates *.html *.txt
 recursive-include hobo/profile/templates *.html *.txt
 recursive-include hobo/seo/templates *.html *.txt
 recursive-include hobo/theme/templates *.html *.txt
diff --git a/hobo/franceconnect/__init__.py b/hobo/franceconnect/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/hobo/franceconnect/templates/hobo/franceconnect_home.html b/hobo/franceconnect/templates/hobo/franceconnect_home.html
deleted file mode 100644
index 7b6f3874..00000000
--- a/hobo/franceconnect/templates/hobo/franceconnect_home.html
+++ /dev/null
@@ -1,24 +0,0 @@
-{% extends "hobo/base.html" %}
-{% load i18n %}
-
-{% block breadcrumb %}
-  {{ block.super }}
-  <a href="{% url 'franceconnect-home' %}">FranceConnect</a>
-{% endblock %}
-
-{% block appbar %}
-  <h2>{% trans 'FranceConnect' %}</h2>
-{% endblock %}
-
-{% block content %}
-
-  <div class="pk-information">
-    <p>
-      {% trans "FranceConnect configuration screen has been moved next to other authentication methods." %}
-    </p>
-    <p>
-      <a class="pk-button" href="{{ idp_url }}manage/authenticators/">{% trans "Go to authentication methods configuration screen" %}</a>
-    </p>
-  </div>
-
-{% endblock %}
diff --git a/hobo/franceconnect/urls.py b/hobo/franceconnect/urls.py
deleted file mode 100644
index 7e13072c..00000000
--- a/hobo/franceconnect/urls.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# hobo - portal to configure and deploy applications
-# Copyright (C) 2015-2019  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.urls import path
-
-from . import views
-
-urlpatterns = [
-    path('', views.home, name='franceconnect-home'),
-]
diff --git a/hobo/franceconnect/views.py b/hobo/franceconnect/views.py
deleted file mode 100644
index 4c3c0b40..00000000
--- a/hobo/franceconnect/views.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# hobo - portal to configure and deploy applications
-# Copyright (C) 2015-2019  Entr'ouvert
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-from django.views.generic import TemplateView
-
-
-class HomeView(TemplateView):
-    template_name = 'hobo/franceconnect_home.html'
-
-
-home = HomeView.as_view()
diff --git a/hobo/settings.py b/hobo/settings.py
index 678c8883..12fa3ea3 100644
--- a/hobo/settings.py
+++ b/hobo/settings.py
@@ -46,7 +46,6 @@ INSTALLED_APPS = (
     'hobo.applications',
     'hobo.debug',
     'hobo.environment',
-    'hobo.franceconnect',
     'hobo.maintenance',
     'hobo.matomo',
     'hobo.profile',
diff --git a/hobo/templates/hobo/home.html b/hobo/templates/hobo/home.html
index f79d1d16..0eca48fe 100644
--- a/hobo/templates/hobo/home.html
+++ b/hobo/templates/hobo/home.html
@@ -111,9 +111,6 @@
       {% endif %}
     </a>
     <a class="button button-paragraph" href="{% url 'sms-home' %}">{% trans 'SMS' %}</a>
-    {% if has_authentic %}
-      <a class="button button-paragraph" href="{% url 'franceconnect-home' %}">FranceConnect</a>
-    {% endif %}
     <a class="button button-paragraph" href="{% url 'matomo-home' %}">{% trans 'User tracking' %}</a>
     <a class="button button-paragraph" href="{% url 'seo-home' %}">{% trans 'Indexing' %}</a>
     <a class="button button-paragraph" href="{% url 'environment-home' %}">{% trans 'Services' %}</a>
diff --git a/hobo/urls.py b/hobo/urls.py
index 29c0842b..6079f0c5 100644
--- a/hobo/urls.py
+++ b/hobo/urls.py
@@ -22,7 +22,6 @@ from .applications.urls import urlpatterns as applications_urls
 from .debug.urls import urlpatterns as debug_urls
 from .emails.urls import urlpatterns as emails_urls
 from .environment.urls import urlpatterns as environment_urls
-from .franceconnect.urls import urlpatterns as franceconnect_urls
 from .maintenance.urls import urlpatterns as maintenance_urls
 from .matomo.urls import urlpatterns as matomo_urls
 from .profile.urls import urlpatterns as profile_urls
@@ -38,7 +37,6 @@ urlpatterns = [
     path('', home, name='home'),
     re_path(r'^sites/', decorated_includes(admin_required, include(environment_urls))),
     re_path(r'^profile/', decorated_includes(admin_required, include(profile_urls))),
-    re_path(r'^franceconnect/', decorated_includes(admin_required, include(franceconnect_urls))),
     re_path(r'^visits-tracking/', decorated_includes(admin_required, include(matomo_urls))),
     re_path(r'^theme/', decorated_includes(admin_required, include(theme_urls))),
     re_path(r'^emails/', decorated_includes(admin_required, include(emails_urls))),
diff --git a/tests/test_home_views.py b/tests/test_home_views.py
index 29557b1e..651fb658 100644
--- a/tests/test_home_views.py
+++ b/tests/test_home_views.py
@@ -21,6 +21,8 @@ def test_home_view(app, admin_user):
     resp = app.get('/')
     assert resp.html.find('h1').text == 'System'
     assert resp.html.find('h2').text == 'System'
+    assert 'franceconnect' not in resp.html
+    app.get('/franceconnect/', status=404)
 
 
 def test_home_view_with_normal_user(app, user):
-- 
2.38.1

