Skip to content

Commit

Permalink
Merge pull request #232 from pedrobaeza/8.0-import_ldap_fix
Browse files Browse the repository at this point in the history
[FIX] users_ldap_populate: Protect ldap library import
  • Loading branch information
nhomar committed Aug 21, 2015
2 parents 8ef3603 + 279755b commit 603ceb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions users_ldap_populate/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"depends": [
'auth_ldap',
],
'external_dependencies': {
'python': ['ldap'],
},
"data": [
'view/users_ldap.xml',
'view/populate_wizard.xml',
Expand Down
8 changes: 7 additions & 1 deletion users_ldap_populate/model/users_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@
##############################################################################

import re
from ldap.filter import filter_format
from openerp.osv import orm
import logging

_logger = logging.getLogger(__name__)

try:
from ldap.filter import filter_format
except ImportError:
_logger.debug('Can not `from ldap.filter import filter_format`.')


class CompanyLDAP(orm.Model):
_inherit = 'res.company.ldap'
Expand Down

0 comments on commit 603ceb8

Please sign in to comment.