From cd498afcb0bcd8d3f2fce98c9747ca1406d9a449 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Mon, 3 Oct 2022 14:22:11 +0200 Subject: [PATCH] misc: apply django-upgrade (#69798) --- combo/apps/assets/urls.py | 3 ++- combo/apps/lingo/urls.py | 3 ++- combo/apps/lingo/views.py | 4 ++-- combo/apps/maps/urls.py | 3 ++- combo/apps/pwa/urls.py | 3 ++- combo/apps/search/urls.py | 3 ++- combo/plugins.py | 3 ++- combo/urls.py | 3 ++- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/combo/apps/assets/urls.py b/combo/apps/assets/urls.py index 62c851c5..ca3e9a8c 100644 --- a/combo/apps/assets/urls.py +++ b/combo/apps/assets/urls.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from django.conf.urls import include, re_path +from django.conf.urls import re_path +from django.urls import include from combo.urls_utils import decorated_includes, staff_required diff --git a/combo/apps/lingo/urls.py b/combo/apps/lingo/urls.py index ed61c868..2a14d598 100644 --- a/combo/apps/lingo/urls.py +++ b/combo/apps/lingo/urls.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from django.conf.urls import include, re_path +from django.conf.urls import re_path +from django.urls import include from combo.urls_utils import decorated_includes, staff_required diff --git a/combo/apps/lingo/views.py b/combo/apps/lingo/views.py index 90b138d5..1d5f214a 100644 --- a/combo/apps/lingo/views.py +++ b/combo/apps/lingo/views.py @@ -808,8 +808,8 @@ class ItemDownloadView(View): if data.status_code != 200: logging.error('failed to retrieve invoice (%r)', data.status_code) messages.error(request, _('We are sorry but an error occured when retrieving the invoice.')) - if self.request.META.get('HTTP_REFERER'): - return HttpResponseRedirect(self.request.META.get('HTTP_REFERER')) + if self.request.headers.get('Referer'): + return HttpResponseRedirect(self.request.headers.get('Referer')) return HttpResponseRedirect('/') r = HttpResponse(data, content_type='application/pdf') diff --git a/combo/apps/maps/urls.py b/combo/apps/maps/urls.py index c35f2f16..ee1e76a6 100644 --- a/combo/apps/maps/urls.py +++ b/combo/apps/maps/urls.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from django.conf.urls import include, re_path +from django.conf.urls import re_path +from django.urls import include from combo.urls_utils import decorated_includes, staff_required diff --git a/combo/apps/pwa/urls.py b/combo/apps/pwa/urls.py index bc44d475..dfd29de2 100644 --- a/combo/apps/pwa/urls.py +++ b/combo/apps/pwa/urls.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from django.conf.urls import include, re_path +from django.conf.urls import re_path +from django.urls import include from combo.urls_utils import decorated_includes, staff_required diff --git a/combo/apps/search/urls.py b/combo/apps/search/urls.py index c3befe1a..5bdfaadf 100644 --- a/combo/apps/search/urls.py +++ b/combo/apps/search/urls.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from django.conf.urls import include, re_path +from django.conf.urls import re_path +from django.urls import include from combo.urls_utils import decorated_includes, manager_required diff --git a/combo/plugins.py b/combo/plugins.py index 138d3c7e..fd367b3c 100644 --- a/combo/plugins.py +++ b/combo/plugins.py @@ -18,8 +18,9 @@ import logging from functools import wraps from django.apps import apps -from django.conf.urls import include, re_path +from django.conf.urls import re_path from django.http import Http404 +from django.urls import include from django.views.debug import technical_404_response from .urls_utils import decorated_includes, staff_required diff --git a/combo/urls.py b/combo/urls.py index 1b7f1740..2a9a0d15 100644 --- a/combo/urls.py +++ b/combo/urls.py @@ -15,10 +15,11 @@ # along with this program. If not, see . from django.conf import settings -from django.conf.urls import include, re_path +from django.conf.urls import re_path from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.urls import include from django.views.i18n import JavaScriptCatalog from . import plugins