From ff236e882884899c96724874e53bf473a8fd17da Mon Sep 17 00:00:00 2001 From: j Date: Fri, 8 Nov 2024 12:47:47 +0000 Subject: [PATCH] only add oidc urls if oidc is enabled --- pandora/urls.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora/urls.py b/pandora/urls.py index 36e9e8f3..993dda65 100644 --- a/pandora/urls.py +++ b/pandora/urls.py @@ -33,11 +33,15 @@ import urlalias.views def serve_static_file(path, location, content_type): return HttpFileResponse(location, content_type=content_type) + urlpatterns = [ #path('admin/', admin.site.urls), - - path('oidc/', include('mozilla_django_oidc.urls')), - +] +if settings.OIDC_RP_CLIENT_ID: + urlpatterns += [ + path('oidc/', include('mozilla_django_oidc.urls')), + ] +urlpatterns += [ re_path(r'^api/locale.(?P.*).json$', translation.views.locale_json), re_path(r'^api/upload/text/?$', text.views.upload), re_path(r'^api/upload/document/?$', document.views.upload),