From 76394827a098c9e68ca6ffd4f1b852668c92b63a Mon Sep 17 00:00:00 2001 From: Axel Hecht Date: Mon, 20 May 2013 15:07:50 +0200 Subject: [PATCH] no bug. When no ldap is available, don't fail excessively --- apps/accounts/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/accounts/views.py b/apps/accounts/views.py index 116470b5..a4880360 100644 --- a/apps/accounts/views.py +++ b/apps/accounts/views.py @@ -14,7 +14,11 @@ from django.utils import simplejson as json from django.contrib.auth.views import login as django_login from forms import AuthenticationForm -from lib.auth.backends import AUTHENTICATION_SERVER_ERRORS +try: + from lib.auth.backends import AUTHENTICATION_SERVER_ERRORS +except ImportError: + # we don't have ldap installed, let's not catch any ldap errors + AUTHENTICATION_SERVER_ERRORS = tuple() from session_csrf import anonymous_csrf