mirror of https://github.com/jumpserver/jumpserver
set user password , if you don't want to change the password , leave password empty
parent
6934380b9c
commit
09087a4d8f
|
@ -227,8 +227,8 @@ def Login(request):
|
|||
# response.set_cookie('username', username, expires=604800)
|
||||
# response.set_cookie('seed', PyCrypt.md5_crypt(password), expires=604800)
|
||||
# return response
|
||||
# else:
|
||||
# error = '密码错误,请重新输入。'
|
||||
else:
|
||||
error = '用户名或密码错误'
|
||||
else:
|
||||
error = '用户名或密码错误'
|
||||
return render_to_response('login.html', {'error': error})
|
||||
|
|
|
@ -86,8 +86,10 @@ def db_update_user(**kwargs):
|
|||
user_id = kwargs.pop('user_id')
|
||||
user = User.objects.get(id=user_id)
|
||||
if user:
|
||||
pwd = kwargs.pop('password')
|
||||
user.update(**kwargs)
|
||||
user.set_password(kwargs.pop('password'))
|
||||
if pwd != '':
|
||||
user.set_password(pwd)
|
||||
user.save()
|
||||
else:
|
||||
return None
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-2 control-label">密码<span class="red-fonts">*</span></label>
|
||||
<label for="password" class="col-sm-2 control-label">密码</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="password" name="password" placeholder="Password" type="password" class="form-control" value="{{ user.password }}">
|
||||
<input id="password" name="password" placeholder="Password" type="password" class="form-control">
|
||||
<span class="help-block m-b-none">
|
||||
登陆web的密码
|
||||
</span>
|
||||
|
@ -155,7 +155,7 @@ $('#userForm').validator({
|
|||
msg: {required: "必须填写!"}
|
||||
},
|
||||
"password": {
|
||||
rule: "required;length[6~50]",
|
||||
rule: "length[6~50]",
|
||||
tip: "输入密码",
|
||||
ok: "",
|
||||
msg: {required: "必须填写!"}
|
||||
|
|
Loading…
Reference in New Issue