浏览代码

change userUpsert

ilya_shyian 2 年之前
父节点
当前提交
7cda3b47f0
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      store_back/apps/authAPI/schema.py

+ 7 - 1
store_back/apps/authAPI/schema.py

@@ -144,6 +144,7 @@ class UserUpsert(graphene.Mutation):
                     ava = Image.objects.get(_id = user.pop("avatar")["_id"])
                 except:
                     raise Exception("Не вірні дані (аватар)")
+        print(ava)
 
         try:
             _id = user._id
@@ -171,9 +172,14 @@ class UserUpsert(graphene.Mutation):
 
         if ava:
             if ava == "null":
+                print(1)
+
                 new_user.avatar = None
+
+
             else:
-                 new_user.avatar = ava
+                print(2)
+                new_user.avatar = ava
 
         new_user.save()