FIX no warning messages when an attribute definition is not set
parent
ebc2530788
commit
54d2c64a5f
|
@ -28,9 +28,10 @@ class CompanyLDAP(orm.Model):
|
|||
_inherit = 'res.company.ldap'
|
||||
_columns = {
|
||||
'name_attribute': fields.char('Name Attribute', size=64,
|
||||
help="Default in 'cn'. For an AD you could use 'displayName' instead."),
|
||||
help="By default 'cn' is used. "
|
||||
"For ActiveDirectory you might use 'displayName' instead."),
|
||||
'mail_attribute': fields.char('E-mail attribute', size=64,
|
||||
help="Active Directory uses the 'mail' attribute."),
|
||||
help="LDAP attribute to use to retrieve em-mail address."),
|
||||
}
|
||||
_defaults = {
|
||||
'mail_attribute': 'mail',
|
||||
|
@ -63,6 +64,7 @@ class CompanyLDAP(orm.Model):
|
|||
]
|
||||
for value_key, conf_name in mapping:
|
||||
try:
|
||||
if conf[conf_name]:
|
||||
values[value_key] = ldap_entry[1][conf[conf_name]][0]
|
||||
except KeyError:
|
||||
_log.warning('No LDAP attribute "%s" found for login "%s"' % (
|
||||
|
|
Loading…
Reference in New Issue