From d604639b96c83778462c478f9d429f1fa5b55807 Mon Sep 17 00:00:00 2001 From: yumaojun <719118794@qq.com> Date: Tue, 22 Dec 2015 23:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0role=20?= =?UTF-8?q?=E6=97=B6=E3=80=80=E5=9B=A0=E7=A7=81=E9=92=A5=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9=E8=80=8C=E5=BC=95=E8=B5=B7=E7=9A=84bug(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jperm/views.py | 2 +- templates/jperm/perm_role_add.html | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jperm/views.py b/jperm/views.py index 7af646f9f..10e6b3fd7 100644 --- a/jperm/views.py +++ b/jperm/views.py @@ -284,7 +284,7 @@ def perm_role_add(request): try: if get_object(PermRole, name=name): - raise ServerError('已经存在该用户 %s' % name) + raise ServerError(u'已经存在该用户 %s' % name) default = get_object(Setting, name='default') if password: diff --git a/templates/jperm/perm_role_add.html b/templates/jperm/perm_role_add.html index ab2ac43b2..70ad918d8 100644 --- a/templates/jperm/perm_role_add.html +++ b/templates/jperm/perm_role_add.html @@ -93,7 +93,7 @@ $('#roleForm').validator({ theme: "yellow_right_effect", rules: { check_name: [/^\w{2,20}$/, '大小写字母数字和下划线,2-20位'], - check_begin: [/^[\-]+BEGIN RSA PRIVATE KEY[\-]+/gm, '请填写正确的RSA Key'], + check_begin: [/^[\-]+BEGIN RSA PRIVATE KEY[\-]+/gm, 'RSA Key填写有误,请检查'], {# either: function(){#} {# return $('#role_password').val() == ''#} {# }#} @@ -107,8 +107,9 @@ $('#roleForm').validator({ msg: {required: "系统用户名称必填"} }, "role_key": { - rule: "required;check_begin", - tip: "请输入正确格式的RSA私钥" + rule: "check_begin", + ok: "", + empty: true }, {# "role_key": {#} {# rule: "required(either)",#}