Projet

Général

Profil

0002-urls-coding-style-29240.patch

Benjamin Dauvergne, 13 mars 2019 18:38

Télécharger (3,09 ko)

Voir les différences:

Subject: [PATCH 2/9] urls: coding style (#29240)

 hobo/urls.py | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)
hobo/urls.py
1
# hobo - portal to configure and deploy applications
2
# Copyright (C) 2015-2019  Entr'ouvert
3
#
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License as published
6
# by the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU Affero General Public License for more details.
13
#
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16

  
1 17
from django.conf import settings
2 18
from django.conf.urls import include, url
3 19

  
4 20
from django.contrib import admin
5
admin.autodiscover()
6 21

  
7 22
from .views import admin_required, login, login_local, logout, home, health_json, menu_json, hobo
8 23
from .urls_utils import decorated_includes
......
12 27
from .theme.urls import urlpatterns as theme_urls
13 28
from .emails.urls import urlpatterns as emails_urls
14 29

  
30
admin.autodiscover()
31

  
15 32
urlpatterns = [
16 33
    url(r'^$', home, name='home'),
17
    url(r'^sites/', decorated_includes(admin_required,
18
                                       include(environment_urls))),
19
    url(r'^profile/', decorated_includes(admin_required,
20
                                             include(profile_urls))),
21
    url(r'^franceconnect/',
22
        decorated_includes(admin_required, include(franceconnect_urls))),
23
    url(r'^theme/', decorated_includes(admin_required,
24
                                             include(theme_urls))),
34
    url(r'^sites/', decorated_includes(admin_required, include(environment_urls))),
35
    url(r'^profile/', decorated_includes(admin_required, include(profile_urls))),
36
    url(r'^franceconnect/', decorated_includes(admin_required, include(franceconnect_urls))),
37
    url(r'^theme/', decorated_includes(admin_required, include(theme_urls))),
25 38
    url(r'^emails/', decorated_includes(admin_required, include(emails_urls))),
26 39
    url(r'^api/health/$', health_json, name='health-json'),
27 40
    url(r'^menu.json$', menu_json, name='menu_json'),
......
33 46
urlpatterns += [
34 47
    url(r'^logout/$', logout, name='logout'),
35 48
    url(r'^login/$', login, name='auth_login'),
36
    url(r'^login/local/$', login_local), # to be used as backup, in case of idp down
49
    url(r'^login/local/$', login_local),  # to be used as backup, in case of idp down
37 50
    url(r'^accounts/mellon/', include('mellon.urls')),
38 51
]
39 52

  
40
-