From be7370a191d94ddfce87a3315b36755cfadaec99 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Mon, 17 Jan 2022 17:52:44 -0400 Subject: [PATCH] Upgrade urls and oidc_provider_settings to Django 3.2 --- steering/oidc_provider_settings.py | 2 +- steering/urls.py | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/steering/oidc_provider_settings.py b/steering/oidc_provider_settings.py index e82cbd7a..c2641cb8 100644 --- a/steering/oidc_provider_settings.py +++ b/steering/oidc_provider_settings.py @@ -18,7 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from oidc_provider.lib.claims import ScopeClaims diff --git a/steering/urls.py b/steering/urls.py index 96cc4a38..7775fb9a 100644 --- a/steering/urls.py +++ b/steering/urls.py @@ -19,7 +19,7 @@ # from django.conf import settings -from django.conf.urls import url, include +from django.urls import include, path from django.contrib import admin from django.views.static import serve from rest_framework_nested import routers @@ -72,19 +72,19 @@ timeslot_router = routers.NestedSimpleRouter(schedule_router, r'timeslots', look timeslot_router.register(r'note', APINoteViewSet, basename='timeslots-note') urlpatterns = [ - url(r'^openid/', include('oidc_provider.urls', namespace='oidc_provider')), - url(r'^api/v1/', include(router.urls)), - url(r'^api/v1/', include(show_router.urls)), - url(r'^api/v1/', include(show_timeslot_router.urls)), - url(r'^api/v1/', include(schedule_router.urls)), - url(r'^api/v1/', include(timeslot_router.urls)), - url(r'^api/v1/playout', json_playout), - url(r'^api/v1/program/week', json_playout), - url(r'^api/v1/program/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', json_day_schedule), - url(r'^admin/', admin.site.urls), - url(r'^program/', include('program.urls')), - url(r'^api/', include('frapp.urls')), + path('openid/', include('oidc_provider.urls', namespace='oidc_provider')), + path('api/v1/', include(router.urls)), + path('api/v1/', include(show_router.urls)), + path('api/v1/', include(show_timeslot_router.urls)), + path('api/v1/', include(schedule_router.urls)), + path('api/v1/', include(timeslot_router.urls)), + path('api/v1/playout', json_playout), + path('api/v1/program/week', json_playout), + path('api/v1/program/<int:year>/<int:month>/<int:day>)/', json_day_schedule), + path('admin/', admin.site.urls), + path('program/', include('program.urls')), + path('api/', include('frapp.urls')), ] if settings.DEBUG: - urlpatterns.append(url(r'^site_media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT})) + urlpatterns.append(path('site_media/<path>', serve, {'document_root': settings.MEDIA_ROOT})) -- GitLab