Explorar o código

change userUpsert

ilya_shyian %!s(int64=2) %!d(string=hai) anos
pai
achega
7cda3b47f0
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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()