Add email to ldap autocomplete
This commit is contained in:
parent
9110e5b185
commit
910536c6d3
1 changed files with 3 additions and 2 deletions
|
@ -129,13 +129,13 @@ class ModelSearch(SearchUnit):
|
|||
# LDAP search
|
||||
# ---
|
||||
|
||||
Clipper = namedtuple("Clipper", ["clipper", "fullname"])
|
||||
Clipper = namedtuple("Clipper", ["clipper", "fullname", "mail"])
|
||||
|
||||
|
||||
class LDAPSearch(SearchUnit):
|
||||
ldap_server_url = getattr(settings, "LDAP_SERVER_URL", None)
|
||||
domain_component = "dc=spi,dc=ens,dc=fr"
|
||||
search_fields = ["cn", "uid"]
|
||||
search_fields = ["cn", "uid", "mail"]
|
||||
|
||||
verbose_name = _("Comptes clippers")
|
||||
|
||||
|
@ -178,6 +178,7 @@ class LDAPSearch(SearchUnit):
|
|||
Clipper(
|
||||
clipper=attrs["uid"][0].decode("utf-8"),
|
||||
fullname=attrs["cn"][0].decode("utf-8"),
|
||||
mail=attrs["mail"][0].decode("utf-8"),
|
||||
)
|
||||
for (_, attrs) in res
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue