Browse Source

change userUpsert

ilya_shyian 2 years ago
parent
commit
7cda3b47f0
1 changed files with 7 additions and 1 deletions
  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()