From fce2f89103a7eba110761a403bc865562478497f Mon Sep 17 00:00:00 2001 From: kakwa Date: Sun, 14 Jun 2015 15:31:43 +0200 Subject: [PATCH] adding notification on addes user --- ldapcherry/__init__.py | 7 ++++++- resources/templates/adduser.tmpl | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 326e897..c1514db 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -458,6 +458,11 @@ class LdapCherry(object): self._check_auth(must_admin=True) is_admin = self._check_admin() + if cherrypy.request.method.upper() == 'POST': + notification = "" + else: + notification = '' + graph={} for r in self.roles.graph: s = list(self.roles.graph[r]['sub_roles']) @@ -470,7 +475,7 @@ class LdapCherry(object): roles_js = json.dumps(display_names, separators=(',',':')) form = self.temp_form.render(attributes=self.attributes.attributes, values=None) roles = self.temp_roles.render(roles=self.roles.flatten, graph=self.roles.graph, graph_js=graph_js, roles_js=roles_js) - return self.temp_adduser.render(form=form, roles=roles, is_admin=is_admin) + return self.temp_adduser.render(form=form, roles=roles, is_admin=is_admin, notification=notification) @cherrypy.expose def delete(self, **params): diff --git a/resources/templates/adduser.tmpl b/resources/templates/adduser.tmpl index 770f480..ab31d42 100644 --- a/resources/templates/adduser.tmpl +++ b/resources/templates/adduser.tmpl @@ -1,5 +1,5 @@ <%inherit file="navbar.tmpl"/> -<%block name="core"> + <%block name="core">