summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-04-25 08:49:24 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-06-18 08:36:30 (GMT)
commitf04cb9ac709c55709d2d5f8d26d5b8a0462c8e12 (patch)
tree2d86057d6e732186d8a4d5529de777e3d900c7d2
parent8788cefe3febbeb4a0e36e2b500e4b2ebedf0f9c (diff)
downloadwelco-f04cb9ac709c55709d2d5f8d26d5b8a0462c8e12.zip
welco-f04cb9ac709c55709d2d5f8d26d5b8a0462c8e12.tar.gz
welco-f04cb9ac709c55709d2d5f8d26d5b8a0462c8e12.tar.bz2
misc: remove usage of django.conf.urls.patterns (#16012)
-rw-r--r--welco/apps.py6
-rw-r--r--welco/contrib/alfortville/urls.py6
-rw-r--r--welco/sources/counter/urls.py7
-rw-r--r--welco/sources/mail/urls.py6
-rw-r--r--welco/sources/phone/urls.py7
-rw-r--r--welco/urls.py13
6 files changed, 20 insertions, 25 deletions
diff --git a/welco/apps.py b/welco/apps.py
index 5b19def..d6b79b3 100644
--- a/welco/apps.py
+++ b/welco/apps.py
@@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.apps import apps
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
def register_urls(urlpatterns):
pre_urls = []
@@ -29,6 +29,4 @@ def register_urls(urlpatterns):
urls = app.get_after_urls()
if urls:
post_urls.append(url('^', include(urls)))
- pre_patterns = patterns('', *pre_urls)
- post_patterns = patterns('', *post_urls)
- return pre_patterns + urlpatterns + post_patterns
+ return pre_urls + urlpatterns + post_urls
diff --git a/welco/contrib/alfortville/urls.py b/welco/contrib/alfortville/urls.py
index 648f512..26f1324 100644
--- a/welco/contrib/alfortville/urls.py
+++ b/welco/contrib/alfortville/urls.py
@@ -14,13 +14,13 @@
# 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.conf.urls import patterns, url
+from django.conf.urls import url
from .views import (dgs, dga, copies, copies_ajax, table_info, table_avis,
table_mandatory_avis, table_waiting, count_dgs, count_dga, count_info,
count_avis, count_mandatory_avis, dgs_qualif_many, dga_qualif_many)
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^dgs/(?P<table>table/)?$', dgs, name='alfortville-dgs'),
url(r'^dga/(?P<table>table/)?$', dga, name='alfortville-dga'),
url(r'^dgs/table/qualif-many$', dgs_qualif_many, name='alfortville-dgs-qualif-many'),
@@ -37,4 +37,4 @@ urlpatterns = patterns('',
url(r'^ajax/count/info/$', count_info, name='alfortville-count-info'),
url(r'^ajax/count/avis/$', count_avis, name='alfortville-count-avis'),
url(r'^ajax/count/avis-requis/$', count_mandatory_avis, name='alfortville-count-avis-requis'),
-)
+]
diff --git a/welco/sources/counter/urls.py b/welco/sources/counter/urls.py
index 40a39c2..f9a9d04 100644
--- a/welco/sources/counter/urls.py
+++ b/welco/sources/counter/urls.py
@@ -14,11 +14,10 @@
# 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.conf.urls import patterns, url
+from django.conf.urls import url
from . import views
-urlpatterns = patterns(
- '',
+urlpatterns = [
url(r'^ajax/counter/zone/$', views.zone, name='counter-zone'),
-)
+]
diff --git a/welco/sources/mail/urls.py b/welco/sources/mail/urls.py
index 5655b35..d37bb82 100644
--- a/welco/sources/mail/urls.py
+++ b/welco/sources/mail/urls.py
@@ -14,12 +14,12 @@
# 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.conf.urls import patterns, url
+from django.conf.urls import url
from .views import (viewer, feeder, qualification_save, edit_note, note,
reject, mail_count)
-urlpatterns = patterns('',
+urlpatterns = [
url('viewer/$', viewer, name='mail-viewer'),
url('mail/feeder/$', feeder, name='mail-feeder'),
url(r'^ajax/mail/reject$', reject, name='mail-reject'),
@@ -27,4 +27,4 @@ urlpatterns = patterns('',
url(r'^ajax/mail/edit-note/$', edit_note, name='mail-edit-note'),
url(r'^ajax/mail/note/(?P<pk>\w+)$', note, name='mail-note'),
url(r'^ajax/count/mail/$', mail_count, name='mail-count'),
-)
+]
diff --git a/welco/sources/phone/urls.py b/welco/sources/phone/urls.py
index ca909e7..ad16b9c 100644
--- a/welco/sources/phone/urls.py
+++ b/welco/sources/phone/urls.py
@@ -14,16 +14,15 @@
# 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.conf.urls import patterns, url
+from django.conf.urls import url
from . import views
-urlpatterns = patterns(
- '',
+urlpatterns = [
url(r'^ajax/phone/zone/$', views.zone, name='phone-zone'),
url(r'^api/phone/call-event/$', views.call_event, name='phone-call-event'),
url(r'^api/phone/active-call/(?P<pk>\w+)/$', views.active_call, name='phone-active-call'),
url(r'^api/phone/current-calls/$', views.current_calls, name='phone-current-calls'),
url(r'^api/phone/take-line/$', views.take_line, name='phone-take-line'),
url(r'^api/phone/release-line/$', views.release_line, name='phone-release-line'),
-)
+]
diff --git a/welco/urls.py b/welco/urls.py
index 56d5d77..d1a59a5 100644
--- a/welco/urls.py
+++ b/welco/urls.py
@@ -14,9 +14,11 @@
# 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.conf.urls import patterns, include, url
from django.conf import settings
+from django.conf.urls import include, url
+from django.conf.urls.static import static
from django.contrib import admin
+from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.decorators.cache import never_cache
from ckeditor import views as ckeditor_views
@@ -24,7 +26,7 @@ from ckeditor import views as ckeditor_views
from . import apps
from .kb.views import kb_manager_required
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^$', 'welco.views.home', name='home'),
url(r'^mail/$', 'welco.views.home_mail', name='home-mail'),
url(r'^phone/$', 'welco.views.home_phone', name='home-phone'),
@@ -66,16 +68,13 @@ urlpatterns = patterns('',
url(r'^ckeditor/upload/', kb_manager_required(ckeditor_views.upload), name='ckeditor_upload'),
url(r'^ckeditor/browse/', never_cache(kb_manager_required(ckeditor_views.browse)), name='ckeditor_browse'),
-)
+]
if 'mellon' in settings.INSTALLED_APPS:
- urlpatterns += patterns('', url(r'^accounts/mellon/', include('mellon.urls')))
+ urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls')))
# static and media files
-from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
-
-from django.conf.urls.static import static
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns = apps.register_urls(urlpatterns)