Merge branch 'dev' of git.coding.net:jumpserver/jumpserver into dev

pull/26/head
ibuler 2015-12-22 23:12:02 +08:00
commit c691759af8
2 changed files with 5 additions and 4 deletions

View File

@ -284,7 +284,7 @@ def perm_role_add(request):
try: try:
if get_object(PermRole, name=name): if get_object(PermRole, name=name):
raise ServerError('已经存在该用户 %s' % name) raise ServerError(u'已经存在该用户 %s' % name)
default = get_object(Setting, name='default') default = get_object(Setting, name='default')
if password: if password:

View File

@ -93,7 +93,7 @@ $('#roleForm').validator({
theme: "yellow_right_effect", theme: "yellow_right_effect",
rules: { rules: {
check_name: [/^\w{2,20}$/, '大小写字母数字和下划线,2-20位'], 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(){#} {# either: function(){#}
{# return $('#role_password').val() == ''#} {# return $('#role_password').val() == ''#}
{# }#} {# }#}
@ -107,8 +107,9 @@ $('#roleForm').validator({
msg: {required: "系统用户名称必填"} msg: {required: "系统用户名称必填"}
}, },
"role_key": { "role_key": {
rule: "required;check_begin", rule: "check_begin",
tip: "请输入正确格式的RSA私钥" ok: "",
empty: true
}, },
{# "role_key": {#} {# "role_key": {#}
{# rule: "required(either)",#} {# rule: "required(either)",#}