mirror of https://github.com/jumpserver/jumpserver
parent
b745ebdda1
commit
69061791ed
|
@ -87,12 +87,12 @@ def db_update_user(**kwargs):
|
|||
admin_groups_post = kwargs.pop('admin_groups')
|
||||
user_id = kwargs.pop('user_id')
|
||||
user = User.objects.filter(id=user_id)
|
||||
user_get = User.objects.get(id=user_id)
|
||||
if user:
|
||||
pwd = kwargs.pop('password')
|
||||
user_get = user[0]
|
||||
password = kwargs.pop('password')
|
||||
user.update(**kwargs)
|
||||
if pwd != '':
|
||||
user_get.set_password(pwd)
|
||||
if password.strip():
|
||||
user_get.set_password(password)
|
||||
user_get.save()
|
||||
else:
|
||||
return None
|
||||
|
|
|
@ -368,11 +368,6 @@ def user_edit(request):
|
|||
else:
|
||||
return HttpResponseRedirect(reverse('user_list'))
|
||||
|
||||
if password != '':
|
||||
password_decode = password
|
||||
else:
|
||||
password_decode = None
|
||||
|
||||
db_update_user(user_id=user_id,
|
||||
password=password,
|
||||
name=name,
|
||||
|
@ -391,7 +386,7 @@ def user_edit(request):
|
|||
密码:%s (如果密码为None代表密码为原密码)
|
||||
权限::%s
|
||||
|
||||
""" % (user.name, URL, user.username, password_decode, user_role.get(role_post, u''))
|
||||
""" % (user.name, URL, user.username, password, user_role.get(role_post, u''))
|
||||
send_mail('您的信息已修改', msg, MAIL_FROM, [email], fail_silently=False)
|
||||
|
||||
return HttpResponseRedirect(reverse('user_list'))
|
||||
|
|
Loading…
Reference in New Issue