conradlan 3 роки тому
батько
коміт
14cf7358c2
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      app/api/api_v1/endpoints/nft.py

+ 2 - 2
app/api/api_v1/endpoints/nft.py

@@ -53,7 +53,7 @@ async def create_item(
         raise HTTPException(status_code=415, detail='content type error! Please upload valid image type')
     filename = str(uuid4()) + '.' + image.content_type.split('/')[1]
     with open(settings.IMG_PATH + filename, 'wb+') as f:
-        await f.write(image.file.read())
+        f.write(image.file.read())
         f.close()
     item_in = schemas.NftCreate
     item_in.hash = hash
@@ -64,7 +64,7 @@ async def create_item(
     item_in.category = catagory
     item_in.imgurl = settings.IMG_HOST + filename
     nft = crud.nft.create_with_owner(
-        db=db, obj_in=item_in, owner_id=current_user.userid)
+        db=db, obj_in=item_in, owner_id=item_in.userid)
     return nft