Project

General

Profile

0002-use-django3.2-compatible-re_path-urls-util-64309.patch

Paul Marillonnet, 20 April 2022 10:14 AM

Download (3.57 KB)

View differences:

Subject: [PATCH 2/6] use django3.2-compatible re_path urls util (#64309)

 mellon/urls.py                    | 10 +++++-----
 tests/urls_tests.py               |  6 +++---
 tests/urls_tests_template_base.py |  6 +++---
 tests/urls_tests_template_hook.py |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)
mellon/urls.py
1 1
import django
2
from django.conf.urls import url
2
from django.urls import re_path
3 3

  
4 4
from . import views
5 5

  
6 6
urlpatterns = [
7
    url('login/$', views.login, name='mellon_login'),
8
    url('login/debug/$', views.debug_login, name='mellon_debug_login'),
9
    url('logout/$', views.logout, name='mellon_logout'),
10
    url('metadata/$', views.metadata, name='mellon_metadata'),
7
    re_path('login/$', views.login, name='mellon_login'),
8
    re_path('login/debug/$', views.debug_login, name='mellon_debug_login'),
9
    re_path('logout/$', views.logout, name='mellon_logout'),
10
    re_path('metadata/$', views.metadata, name='mellon_metadata'),
11 11
]
tests/urls_tests.py
13 13
# You should have received a copy of the GNU Affero General Public License
14 14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 15

  
16
from django.conf.urls import include, url
17 16
from django.http import HttpResponse
17
from django.urls import include, re_path
18 18

  
19 19

  
20 20
def homepage(request):
......
22 22

  
23 23

  
24 24
urlpatterns = [
25
    url('^', include('mellon.urls')),
26
    url('^$', homepage, name='homepage'),
25
    re_path('^', include('mellon.urls')),
26
    re_path('^$', homepage, name='homepage'),
27 27
]
tests/urls_tests_template_base.py
13 13
# You should have received a copy of the GNU Affero General Public License
14 14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 15

  
16
from django.conf.urls import include, url
17 16
from django.http import HttpResponse
17
from django.urls import include, re_path
18 18

  
19 19

  
20 20
def homepage(request):
......
22 22

  
23 23

  
24 24
urlpatterns = [
25
    url('^', include('mellon.urls'), kwargs={'template_base': 'theme.html'}),
26
    url('^$', homepage, name='homepage'),
25
    re_path('^', include('mellon.urls'), kwargs={'template_base': 'theme.html'}),
26
    re_path('^$', homepage, name='homepage'),
27 27
]
tests/urls_tests_template_hook.py
13 13
# You should have received a copy of the GNU Affero General Public License
14 14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 15

  
16
from django.conf.urls import include, url
17 16
from django.http import HttpResponse
17
from django.urls import include, re_path
18 18

  
19 19

  
20 20
def homepage(request):
......
26 26

  
27 27

  
28 28
urlpatterns = [
29
    url(
29
    re_path(
30 30
        '^',
31 31
        include('mellon.urls'),
32 32
        kwargs={
......
34 34
            'context_hook': context_hook,
35 35
        },
36 36
    ),
37
    url('^$', homepage, name='homepage'),
37
    re_path('^$', homepage, name='homepage'),
38 38
]
39
-