mirror of https://github.com/jumpserver/jumpserver
juser/user_list change user password fix
parent
85dcc8ba63
commit
ce90472624
|
@ -84,10 +84,10 @@ def db_update_user(**kwargs):
|
||||||
groups_post = kwargs.pop('groups')
|
groups_post = kwargs.pop('groups')
|
||||||
admin_groups_post = kwargs.pop('admin_groups')
|
admin_groups_post = kwargs.pop('admin_groups')
|
||||||
user_id = kwargs.pop('user_id')
|
user_id = kwargs.pop('user_id')
|
||||||
user = User.objects.filter(id=user_id)
|
user = User.objects.get(id=user_id)
|
||||||
if user:
|
if user:
|
||||||
user.update(**kwargs)
|
user.update(**kwargs)
|
||||||
user = user[0]
|
user.set_password(kwargs.pop('password'))
|
||||||
user.save()
|
user.save()
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -532,11 +532,11 @@ def user_edit(request):
|
||||||
else:
|
else:
|
||||||
return HttpResponseRedirect('/juser/user_list/')
|
return HttpResponseRedirect('/juser/user_list/')
|
||||||
|
|
||||||
if password != user.password:
|
# if password != user.password:
|
||||||
password_decode = password
|
# password_decode = password
|
||||||
password = CRYPTOR.md5_crypt(password)
|
# password = CRYPTOR.md5_crypt(password)
|
||||||
else:
|
# else:
|
||||||
password_decode = None
|
# password_decode = None
|
||||||
|
|
||||||
db_update_user(user_id=user_id,
|
db_update_user(user_id=user_id,
|
||||||
password=password,
|
password=password,
|
||||||
|
|
Loading…
Reference in New Issue