From 4e06f257b96c33fcd832a3d9596e147779c4fde9 Mon Sep 17 00:00:00 2001 From: Helen Sherwood-Taylor Date: Fri, 9 Jun 2017 14:38:24 +0000 Subject: [PATCH] Only include shibboleth urls if app installed --- storage_service/storage_service/urls.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/storage_service/storage_service/urls.py b/storage_service/storage_service/urls.py index 2fae1db6e..5a99de1f1 100644 --- a/storage_service/storage_service/urls.py +++ b/storage_service/storage_service/urls.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.conf.urls import include, url from django.contrib import admin import django.contrib.auth.views @@ -29,10 +30,15 @@ url(r'^i18n/', include('django.conf.urls.i18n', namespace='i18n')), url(r'^logged-out/', TemplateView.as_view(template_name='logged_out.html')), - url(r'^shib/', include('shibboleth.urls', namespace='shibboleth')), ] +if 'shibboleth' in settings.INSTALLED_APPS: + urlpatterns += [ + url(r'^shib/', include('shibboleth.urls', namespace='shibboleth')), + ] + + def startup(): import django.core.exceptions import errno