From 86a9c466431f4eba65b12f845915cfd782362b85 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Mon, 29 Sep 2014 20:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E9=83=BD=E6=83=B3=E5=90=90=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webroot/AutoSa/AutoSa/views.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/webroot/AutoSa/AutoSa/views.py b/webroot/AutoSa/AutoSa/views.py index f381cc466..73d6175f4 100644 --- a/webroot/AutoSa/AutoSa/views.py +++ b/webroot/AutoSa/AutoSa/views.py @@ -472,13 +472,13 @@ def chgUser(request): if not username: return HttpResponseRedirect('/showUser/') user = User.objects.get(username=username) - is_admin = "checked" if user.is_admin else '' - is_superuser = 'checked' if user.is_superuser else '' + ori_is_admin = "checked" if user.is_admin else '' + ori_is_superuser = 'checked' if user.is_superuser else '' all_groups = user.group.all() return render_to_response('chgUser.html', - {'user': user, 'user_menu': 'active', 'is_admin': is_admin, - 'is_superuser': is_superuser, 'groups': all_groups}, + {'user': user, 'user_menu': 'active', 'is_admin': ori_is_admin, + 'is_superuser': ori_is_superuser, 'groups': all_groups}, context_instance=RequestContext(request)) else: username = request.POST.get('username') @@ -492,11 +492,11 @@ def chgUser(request): group_post = request.REQUEST.getlist('group') groups = [] user = User.objects.get(username=username) - is_admin = "checked" if user.is_admin else '' - is_superuser = 'checked' if user.is_superuser else '' all_groups = Group.objects.all() keyfile = '%s/keys/%s' % (base_dir, username) + ori_is_admin = "checked" if user.is_admin else '' + ori_is_superuser = 'checked' if user.is_superuser else '' for group_name in group_post: groups.append(Group.objects.get(name=group_name)) @@ -527,8 +527,8 @@ def chgUser(request): if error: return render_to_response('chgUser.html', - {'user': user, 'user_menu': 'active', 'is_admin': is_admin, - 'is_superuser': is_superuser, 'groups': all_groups, 'error': error}, + {'user': user, 'user_menu': 'active', 'is_admin': ori_is_admin, + 'is_superuser': ori_is_superuser, 'groups': all_groups, 'error': error}, context_instance=RequestContext(request)) u.password = md5_crypt(password)