diff --git a/swh/web/admin/__init__.py b/swh/web/admin/__init__.py deleted file mode 100644 diff --git a/swh/web/admin/adminurls.py b/swh/web/admin/adminurls.py deleted file mode 100644 --- a/swh/web/admin/adminurls.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2018-2019 The Software Heritage developers -# See the AUTHORS file at the top-level directory of this distribution -# License: GNU Affero General Public License version 3, or any later version -# See top-level LICENSE file for more information - -from swh.web.common.urlsindex import UrlsIndex - - -class AdminUrls(UrlsIndex): - """ - Class to manage swh-web admin urls. - """ - - scope = "admin" - - -def admin_route(*url_patterns, view_name=None): - """ - Decorator to ease the registration of a swh-web admin endpoint - - Args: - url_patterns: list of url patterns used by Django to identify the - admin routes - view_name: the name of the Django view associated to the routes used - to reverse the url - """ - url_patterns = ["^" + url_pattern + "$" for url_pattern in url_patterns] - - def decorator(f): - # register the route and its view in the browse endpoints index - for url_pattern in url_patterns: - AdminUrls.add_url_pattern(url_pattern, f, view_name) - return f - - return decorator diff --git a/swh/web/admin/urls.py b/swh/web/admin/urls.py deleted file mode 100644 --- a/swh/web/admin/urls.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2018-2022 The Software Heritage developers -# See the AUTHORS file at the top-level directory of this distribution -# License: GNU Affero General Public License version 3, or any later version -# See top-level LICENSE file for more information - - -from django.shortcuts import redirect -from django.urls import re_path as url - -from swh.web.admin.adminurls import AdminUrls - - -def _admin_default_view(request): - return redirect("admin-origin-save-requests") - - -urlpatterns = [ - url(r"^$", _admin_default_view, name="admin"), -] - -urlpatterns += AdminUrls.get_url_patterns() diff --git a/swh/web/tests/admin/__init__.py b/swh/web/tests/admin/__init__.py deleted file mode 100644 diff --git a/swh/web/urls.py b/swh/web/urls.py --- a/swh/web/urls.py +++ b/swh/web/urls.py @@ -36,7 +36,6 @@ urlpatterns = [ - url(r"^admin/", include("swh.web.admin.urls")), url(r"^favicon\.ico/$", favicon_view), url(r"^$", _default_view, name="swh-web-homepage"), url(r"^jsreverse/$", urls_js, name="js_reverse"),