diff --git a/jperm/views.py b/jperm/views.py index 4e4756749..d99527f9b 100644 --- a/jperm/views.py +++ b/jperm/views.py @@ -350,6 +350,7 @@ def perm_role_edit(request): role_pass = CRYPTOR.decrypt(role.password) sudo_all = PermSudo.objects.all() role_sudos = role.sudo.all() + sudo_all = PermSudo.objects.all() if request.method == "GET": return my_render('jperm/perm_role_edit.html', locals(), request) @@ -361,6 +362,7 @@ def perm_role_edit(request): role_sudo_names = request.POST.getlist("sudo_name") role_sudos = [PermSudo.objects.get(id=sudo_id) for sudo_id in role_sudo_names] key_content = request.POST.get("role_key", "") + try: if not role: raise ServerError('角色用户不能存在') @@ -379,6 +381,7 @@ def perm_role_edit(request): role.name = role_name role.comment = role_comment role.sudo = role_sudos + role.save() msg = u"更新系统角色: %s" % role.name return HttpResponseRedirect('/jperm/role/') diff --git a/jumpserver.conf b/jumpserver.conf index 6297ab00a..ac9506672 100644 --- a/jumpserver.conf +++ b/jumpserver.conf @@ -9,7 +9,7 @@ log = debug host = 127.0.0.1 port = 3306 user = jumpserver -password = mysql234 +password = mysql1234 database = jumpserver [websocket] diff --git a/templates/jperm/perm_role_edit.html b/templates/jperm/perm_role_edit.html index 7f5e2cc5d..4d587a972 100644 --- a/templates/jperm/perm_role_edit.html +++ b/templates/jperm/perm_role_edit.html @@ -58,7 +58,7 @@
-
+
+