diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 641ad512f46a4..b706f637677de 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -38,6 +38,7 @@ from openerp.http import request, serialize_exception as _serialize_exception, content_disposition from openerp.exceptions import AccessError, UserError from openerp.service.report import exp_report, exp_report_get +from ldap import LDAPError _logger = logging.getLogger(__name__) @@ -478,7 +479,10 @@ def web_login(self, redirect=None, **kw): if request.httprequest.method == 'POST': old_uid = request.uid - uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password']) + try: + uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password']) + except LDAPError: + uid = False if uid is not False: request.params['login_success'] = True if not redirect: