Skip to content

Commit

Permalink
replace django.conf.urls.url with django.urls.path / re_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrik Müller committed Feb 28, 2023
1 parent 76bef6e commit 1277cce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions campaign/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

from django import forms
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.admin.utils import unquote
from django.core.exceptions import PermissionDenied
from django.core.management import call_command
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render
from django.urls import re_path
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import mark_safe
Expand Down Expand Up @@ -98,7 +98,7 @@ def wrapper(*args, **kwargs):

super_urlpatterns = super(CampaignAdmin, self).get_urls()
urlpatterns = [
url(r'^(.+)/send/$',
re_path(r'^(.+)/send/$',
wrap(self.send_view),
name='%s_%s_send' % info),
]
Expand Down Expand Up @@ -129,7 +129,7 @@ def wrapper(*args, **kwargs):

super_urlpatterns = super(BlacklistEntryAdmin, self).get_urls()
urlpatterns = [
url(r'^fetch_mandrill_rejects/$',
re_path(r'^fetch_mandrill_rejects/$',
wrap(self.fetch_mandrill_rejects),
name='%s_%s_fetchmandrillrejects' % info),
]
Expand Down Expand Up @@ -188,7 +188,7 @@ def wrapper(*args, **kwargs):

super_urlpatterns = super(SubscriberListAdmin, self).get_urls()
urlpatterns = [
url(r'^(.+)/preview/$',
re_path(r'^(.+)/preview/$',
wrap(self.preview_view),
name='%s_%s_preview' % info),
]
Expand Down
7 changes: 3 additions & 4 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from django.contrib import admin
#from django.urls import path, include
from django.conf.urls import url, include
from django.urls import path, include

urlpatterns = [
url('admin/', admin.site.urls),
url('campaign/', include('campaign.urls')),
path('admin/', admin.site.urls),
path('campaign/', include('campaign.urls')),
]

0 comments on commit 1277cce

Please sign in to comment.