From 8b91d5774f0958af545f0efe1c43485033a71944 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Sat, 10 Jan 2015 15:15:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- juser/views.py | 22 ++++++++++----------- templates/juser/group_add.html | 8 ++++---- templates/juser/user_add.html | 36 +++++++++++++++++----------------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/juser/views.py b/juser/views.py index 6802616fb..554274430 100644 --- a/juser/views.py +++ b/juser/views.py @@ -13,8 +13,8 @@ def group_add(request): error = '' msg = '' if request.method == 'POST': - group_name = request.POST.get('j_group_name', None) - comment = request.POST.get('j_comment', None) + group_name = request.POST.get('group_name', None) + comment = request.POST.get('comment', None) try: if not group_name: @@ -77,15 +77,15 @@ def user_add(request): user_role = {'SU': u'超级管理员', 'GA': u'组管理员', 'CU': u'普通用户'} all_group = UserGroup.objects.all() if request.method == 'POST': - username = request.POST.get('j_username', None) - password = request.POST.get('j_password', None) - name = request.POST.get('j_name', None) - email = request.POST.get('j_email', '') - groups = request.POST.getlist('j_group', None) - role = request.POST.get('j_role', None) - ssh_pwd = request.POST.get('j_ssh_pwd', None) - ssh_key_pwd1 = request.POST.get('j_ssh_key_pwd1', None) - is_active = request.POST.get('j_is_active', None) + username = request.POST.get('username', None) + password = request.POST.get('password', None) + name = request.POST.get('name', None) + email = request.POST.get('email', '') + groups = request.POST.getlist('groups', None) + role = request.POST.get('role', None) + ssh_pwd = request.POST.get('ssh_pwd', None) + ssh_key_pwd1 = request.POST.get('ssh_key_pwd1', None) + is_active = request.POST.get('is_active', '1') try: if None in [username, password, ssh_key_pwd1, name, groups, role, is_active]: diff --git a/templates/juser/group_add.html b/templates/juser/group_add.html index 11bd489f0..da5481b35 100644 --- a/templates/juser/group_add.html +++ b/templates/juser/group_add.html @@ -35,16 +35,16 @@
{{ msg }}
{% endif %}
- +
- +
- +
- +
diff --git a/templates/juser/user_add.html b/templates/juser/user_add.html index 72048a182..01430bbfe 100644 --- a/templates/juser/user_add.html +++ b/templates/juser/user_add.html @@ -35,16 +35,16 @@
{{ msg }}
{% endif %}
- +
- +
- +
- + 登陆web的密码 @@ -52,9 +52,9 @@
- +
- + 登陆 Jumpserver 使用的SSH密钥的密码 @@ -62,16 +62,16 @@
- +
- +
- +
- {% for group in all_group %} {% if forloop.first %} @@ -84,9 +84,9 @@
- +
- {% for r, role in roles.items %} {% endfor %} @@ -95,9 +95,9 @@
- +
- + 如果使用password方式,该密码是用户在后端服务器的密码 @@ -105,9 +105,9 @@
- +
- +
@@ -115,10 +115,10 @@
- +
- +