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')
|
||||
admin_groups_post = kwargs.pop('admin_groups')
|
||||
user_id = kwargs.pop('user_id')
|
||||
user = User.objects.filter(id=user_id)
|
||||
user = User.objects.get(id=user_id)
|
||||
if user:
|
||||
user.update(**kwargs)
|
||||
user = user[0]
|
||||
user.set_password(kwargs.pop('password'))
|
||||
user.save()
|
||||
else:
|
||||
return None
|
||||
|
|
|
@ -532,11 +532,11 @@ def user_edit(request):
|
|||
else:
|
||||
return HttpResponseRedirect('/juser/user_list/')
|
||||
|
||||
if password != user.password:
|
||||
password_decode = password
|
||||
password = CRYPTOR.md5_crypt(password)
|
||||
else:
|
||||
password_decode = None
|
||||
# if password != user.password:
|
||||
# password_decode = password
|
||||
# password = CRYPTOR.md5_crypt(password)
|
||||
# else:
|
||||
# password_decode = None
|
||||
|
||||
db_update_user(user_id=user_id,
|
||||
password=password,
|
||||
|
|
Loading…
Reference in New Issue