Skip to content

Commit 9374496

Browse files
committed
replace usages of url() with re_path()
1 parent ceec50c commit 9374496

File tree

9 files changed

+50
-51
lines changed

9 files changed

+50
-51
lines changed

ocfweb/account/urls.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.account.chpass import change_password
44
from ocfweb.account.commands import commands
@@ -17,24 +17,24 @@
1717

1818

1919
urlpatterns = [
20-
url(r'^password/$', change_password, name='change_password'),
21-
url(r'^commands/$', commands, name='commands'),
20+
re_path(r'^password/$', change_password, name='change_password'),
21+
re_path(r'^commands/$', commands, name='commands'),
2222

2323
# account creation
24-
url(r'^register/$', request_account, name='register'),
25-
url(r'^register/wait/$', wait_for_account, name='wait_for_account'),
26-
url(r'^register/created/$', account_created, name='account_created'),
27-
url(r'^register/pending/$', account_pending, name='account_pending'),
28-
url(r'^register/recommend/$', recommend, name='recommend'),
29-
url(r'^register/validate/$', validate, name='validate'),
24+
re_path(r'^register/$', request_account, name='register'),
25+
re_path(r'^register/wait/$', wait_for_account, name='wait_for_account'),
26+
re_path(r'^register/created/$', account_created, name='account_created'),
27+
re_path(r'^register/pending/$', account_pending, name='account_pending'),
28+
re_path(r'^register/recommend/$', recommend, name='recommend'),
29+
re_path(r'^register/validate/$', validate, name='validate'),
3030

3131
# request vhost
32-
url(r'^vhost/$', request_vhost, name='request_vhost'),
33-
url(r'^vhost/success/$', request_vhost_success, name='request_vhost_success'),
32+
re_path(r'^vhost/$', request_vhost, name='request_vhost'),
33+
re_path(r'^vhost/success/$', request_vhost_success, name='request_vhost_success'),
3434

3535
# mail vhost management
36-
url(r'^vhost/mail/$', vhost_mail, name='vhost_mail'),
37-
url(r'^vhost/mail/update/$', vhost_mail_update, name='vhost_mail_update'),
38-
url(r'vhost/mail/import/([0-9a-zA-Z-.]+)/$', vhost_mail_csv_import, name='vhost_mail_csv_import'),
39-
url(r'vhost/mail/export/([0-9a-zA-Z-.]+)/$', vhost_mail_csv_export, name='vhost_mail_csv_export'),
36+
re_path(r'^vhost/mail/$', vhost_mail, name='vhost_mail'),
37+
re_path(r'^vhost/mail/update/$', vhost_mail_update, name='vhost_mail_update'),
38+
re_path(r'vhost/mail/import/([0-9a-zA-Z-.]+)/$', vhost_mail_csv_import, name='vhost_mail_csv_import'),
39+
re_path(r'vhost/mail/export/([0-9a-zA-Z-.]+)/$', vhost_mail_csv_export, name='vhost_mail_csv_export'),
4040
]

ocfweb/announcements/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.announcements.announcements import announcements
44
from ocfweb.announcements.announcements import index
55

66

77
urlpatterns = [
8-
url(r'^$', index, name='announcements'),
8+
re_path(r'^$', index, name='announcements'),
99
] + [
10-
url(
10+
re_path(
1111
f'^{announcement.date.isoformat()}/{announcement.path}$',
1212
announcement.render,
1313
name=announcement.route_name,

ocfweb/docs/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from itertools import chain
33
from typing import Union
44

5-
from django.conf.urls import url
5+
from django.urls import re_path
66
from django.http import Http404
77
from django.http import HttpRequest
88
from django.http import HttpResponse
@@ -71,11 +71,11 @@ def doc_name(doc_name: str) -> str:
7171

7272

7373
urlpatterns = [
74-
url(r'^$', docs_index, name='docs'),
74+
re_path(r'^$', docs_index, name='docs'),
7575

7676
# we use a complicated generated regex here so that we have actual
7777
# validation of URLs (in other words, if you try to make a link to a
7878
# missing document, it will fail)
79-
url(fr'^({redir_names})/$', send_redirect),
80-
url(fr'^({doc_names})/$', render_doc, name='doc'),
79+
re_path(fr'^({redir_names})/$', send_redirect),
80+
re_path(fr'^({doc_names})/$', render_doc, name='doc'),
8181
]

ocfweb/lab_reservations/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.lab_reservations.reserve import request_reservation
44
from ocfweb.lab_reservations.reserve import request_reservation_success
55

66

77
urlpatterns = [
88
# reservation creation form
9-
url(r'^request/$', request_reservation, name='request_reservation'),
9+
re_path(r'^request/$', request_reservation, name='request_reservation'),
1010

1111
# reservation pending
12-
url(r'^request/pending/$', request_reservation_success, name='request_reservation_success'),
12+
re_path(r'^request/pending/$', request_reservation_success, name='request_reservation_success'),
1313
]

ocfweb/login/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.login.calnet import login as calnet_login
44
from ocfweb.login.calnet import logout as calnet_logout
@@ -7,9 +7,9 @@
77

88

99
urlpatterns = [
10-
url(r'^login/$', login, name='login'),
11-
url(r'^logout/$', logout, name='logout'),
10+
re_path(r'^login/$', login, name='login'),
11+
re_path(r'^logout/$', logout, name='logout'),
1212

13-
url(r'^calnet/login/$', calnet_login, name='calnet_login'),
14-
url(r'^calnet/logout/$', calnet_logout, name='calnet_logout'),
13+
re_path(r'^calnet/login/$', calnet_login, name='calnet_login'),
14+
re_path(r'^calnet/logout/$', calnet_logout, name='calnet_logout'),
1515
]

ocfweb/stats/urls.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.stats.accounts import stats_accounts
44
from ocfweb.stats.daily_graph import daily_graph_image
@@ -15,18 +15,18 @@
1515
from ocfweb.stats.summary import summary
1616

1717
urlpatterns = [
18-
url(r'^$', summary, name='stats'),
19-
url(r'^daily-graph/graph$', daily_graph_image, name='daily_graph_image'),
20-
url(r'^session-count/graph$', session_count_image, name='session_count_image'),
21-
url(r'^session-length/graph$', session_length_image, name='session_length_image'),
22-
url(r'^printing/$', stats_printing, name='stats_printing'),
23-
url(r'^accounts/$', stats_accounts, name='stats_accounts'),
24-
url(r'^printing/semester-histogram/graph$', semester_histogram, name='semester_histogram'),
25-
url(r'^printing/pages-printed$', pages_printed, name='pages_printed'),
26-
url(r'^printing/daily-job/graph$', daily_jobs_image, name='daily_job_image'),
27-
url(r'^printing/weekend-jobs/graph$', weekend_jobs_image, name='weekend_jobs_image'),
28-
url(r'^printing/weekday-jobs/graph$', weekday_jobs_image, name='weekday_jobs_image'),
18+
re_path(r'^$', summary, name='stats'),
19+
re_path(r'^daily-graph/graph$', daily_graph_image, name='daily_graph_image'),
20+
re_path(r'^session-count/graph$', session_count_image, name='session_count_image'),
21+
re_path(r'^session-length/graph$', session_length_image, name='session_length_image'),
22+
re_path(r'^printing/$', stats_printing, name='stats_printing'),
23+
re_path(r'^accounts/$', stats_accounts, name='stats_accounts'),
24+
re_path(r'^printing/semester-histogram/graph$', semester_histogram, name='semester_histogram'),
25+
re_path(r'^printing/pages-printed$', pages_printed, name='pages_printed'),
26+
re_path(r'^printing/daily-job/graph$', daily_jobs_image, name='daily_job_image'),
27+
re_path(r'^printing/weekend-jobs/graph$', weekend_jobs_image, name='weekend_jobs_image'),
28+
re_path(r'^printing/weekday-jobs/graph$', weekday_jobs_image, name='weekday_jobs_image'),
2929

30-
url(r'^mirrors/$', stats_mirrors, name='stats_mirrors'),
31-
url(r'^session-stats/$', session_stats, name='session-stats'),
30+
re_path(r'^mirrors/$', stats_mirrors, name='stats_mirrors'),
31+
re_path(r'^session-stats/$', session_stats, name='session-stats'),
3232
]

ocfweb/tv/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ocfweb.tv import main
44

55
urlpatterns = [
6-
url(r'^$', main.tv_main, name='tv_main'),
7-
url(r'^labmap$', main.tv_labmap, name='tv_labmap'),
6+
re_path(r'^$', main.tv_main, name='tv_main'),
7+
re_path(r'^labmap$', main.tv_labmap, name='tv_labmap'),
88
]

ocfweb/urls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from django.conf.urls import include
2-
from django.conf.urls import re_path
1+
from django.urls import include, re_path
32
from django.http import HttpResponse
43
from django.shortcuts import redirect
54
from django.urls import reverse

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ldap3==2.9.1
3535
libsass==0.23.0
3636
MarkupSafe==3.0.2
3737
matplotlib==3.10.5
38-
mistune==3.1.3
38+
mistune==0.8.4
3939
numpy==2.3.2
4040
ocflib==2024.4.23
4141
packaging==25.0
@@ -46,7 +46,7 @@ ply==3.11
4646
prometheus_client==0.22.1
4747
prompt_toolkit==3.0.51
4848
ptyprocess==0.7.0
49-
pyasn1==0.6.1
49+
pyasn1==0.6.0
5050
pycparser==2.22
5151
pycryptodome==3.23.0
5252
pycryptodomex==3.23.0

0 commit comments

Comments
 (0)