Use ldap email

This commit is contained in:
Ludovic Stephan 2020-08-03 14:30:21 +02:00
parent 910536c6d3
commit 7931f50611
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ class BDSOthersSearch(autocomplete.ModelSearch):
class BDSLDAPSearch(autocomplete.LDAPSearch):
def result_link(self, clipper):
url = reverse("bds:user.create.fromclipper", args=(clipper.clipper,))
get = {"fullname": clipper.fullname}
get = {"fullname": clipper.fullname, "mail": clipper.mail}
return "{}?{}".format(url, urlencode(get))

View file

@ -73,7 +73,7 @@ class UserCreateView(StaffRequiredMixin, MultipleFormView):
def get_user_initial(self):
if "clipper" in self.kwargs:
clipper = self.kwargs["clipper"]
email = "{}@clipper.ens.fr".format(clipper)
email = self.request.GET.get("mail", "{}@clipper.ens.fr".format(clipper))
fullname = self.request.GET.get("fullname", None)
if fullname: