From de337c80c23445986283a3ac57271c61c039bdcb Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 8 Mar 2019 02:39:44 +0100 Subject: [PATCH 2/9] urls: coding style (#29240) --- hobo/urls.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/hobo/urls.py b/hobo/urls.py index d0f0d52..1671974 100644 --- a/hobo/urls.py +++ b/hobo/urls.py @@ -1,8 +1,23 @@ +# 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 . + from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -admin.autodiscover() from .views import admin_required, login, login_local, logout, home, health_json, menu_json, hobo from .urls_utils import decorated_includes @@ -12,16 +27,14 @@ from .profile.urls import urlpatterns as profile_urls from .theme.urls import urlpatterns as theme_urls from .emails.urls import urlpatterns as emails_urls +admin.autodiscover() + urlpatterns = [ url(r'^$', home, name='home'), - url(r'^sites/', decorated_includes(admin_required, - include(environment_urls))), - url(r'^profile/', decorated_includes(admin_required, - include(profile_urls))), - url(r'^franceconnect/', - decorated_includes(admin_required, include(franceconnect_urls))), - url(r'^theme/', decorated_includes(admin_required, - include(theme_urls))), + url(r'^sites/', decorated_includes(admin_required, include(environment_urls))), + url(r'^profile/', decorated_includes(admin_required, include(profile_urls))), + url(r'^franceconnect/', decorated_includes(admin_required, include(franceconnect_urls))), + url(r'^theme/', decorated_includes(admin_required, include(theme_urls))), url(r'^emails/', decorated_includes(admin_required, include(emails_urls))), url(r'^api/health/$', health_json, name='health-json'), url(r'^menu.json$', menu_json, name='menu_json'), @@ -33,7 +46,7 @@ urlpatterns = [ urlpatterns += [ url(r'^logout/$', logout, name='logout'), url(r'^login/$', login, name='auth_login'), - url(r'^login/local/$', login_local), # to be used as backup, in case of idp down + url(r'^login/local/$', login_local), # to be used as backup, in case of idp down url(r'^accounts/mellon/', include('mellon.urls')), ] -- 2.20.1