fix issues

pull/410/head
vapao 2021-09-28 11:17:05 +08:00
parent 4e8299beec
commit 26b12a609b
1 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,8 @@ class UserView(View):
role_ids, password = form.pop('role_ids'), form.pop('password') role_ids, password = form.pop('role_ids'), form.pop('password')
if form.id: if form.id:
User.objects.filter(pk=form.id).update(**form) user = User.objects.get(pk=form.id)
user.update_by_dict(form)
else: else:
user = User.objects.create( user = User.objects.create(
password_hash=User.make_password(password), password_hash=User.make_password(password),