diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 7ec8252..f687882 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -748,7 +748,8 @@ user_roles = tmp['roles'] user_lonely_groups = tmp['unusedgroups'] roles_js = json.dumps(display_names, separators=(',',':')) - form = self.temp_form.render(attributes=self.attributes.attributes, values=user_attrs, modify=True) + key = self.attributes.get_key() + form = self.temp_form.render(attributes=self.attributes.attributes, values=user_attrs, modify=True, keyattr=key) roles = self.temp_roles.render(roles=self.roles.flatten, graph=self.roles.graph, graph_js=graph_js, roles_js=roles_js, current_roles=user_roles) return self.temp_modify.render(form=form, roles=roles, is_admin=is_admin, notification=notification, standalone_groups=user_lonely_groups) diff --git a/resources/templates/form.tmpl b/resources/templates/form.tmpl index ff38aaf..bf03400 100644 --- a/resources/templates/form.tmpl +++ b/resources/templates/form.tmpl @@ -36,7 +36,10 @@ %> ${attr['display_name']} - % if attr['type'] == 'string': + % if modify and a == keyattr: + + ${tmp} + % elif attr['type'] == 'string': % elif attr['type'] == 'email':