Browse Source

add change password to mutate user

ilya_shyian 1 year ago
parent
commit
89baf0cbd8
1 changed files with 2 additions and 0 deletions
  1. 2 0
      store_back/apps/authAPI/schema.py

+ 2 - 0
store_back/apps/authAPI/schema.py

@@ -185,6 +185,8 @@ class UserUpsert(graphene.Mutation):
                 try:
                     new_user = User.objects.get(username = info.context.user.username)
                     new_user.__dict__.update(**user)
+                    if password:
+                        new_user.set_password(password)
                 except:
                     raise Exception("Не вірні дані")
             else: