From 1a2dead92bb7fa7bcf976a7d9e20860d6bbf318c Mon Sep 17 00:00:00 2001 From: Daniel Klaffenbach Date: Thu, 18 Apr 2019 11:43:59 +0200 Subject: [PATCH] tuc2014.urls: Add a better exception if crispy_forms was not found Normally we don't require crispy_forms, but the language picker uses it. Make this clear through a better exception message. --- tuc2014/urls.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tuc2014/urls.py b/tuc2014/urls.py index 14dd44b..65b163b 100644 --- a/tuc2014/urls.py +++ b/tuc2014/urls.py @@ -1,7 +1,12 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import include, url -from .views import change_language +from django.core.exceptions import ImproperlyConfigured + +try: + from .views import change_language +except ImportError: + raise ImproperlyConfigured("crispy_forms is required for the tuc2014 language picker.") urlpatterns = [ url(r'^i18n/', include('django.conf.urls.i18n', namespace='djangoi18n')), -- GitLab