feat: new handies for ozon
This commit is contained in:
		@@ -36,7 +36,7 @@ class OzonProductSynchronizer(BaseProductSynchronizer):
 | 
			
		||||
        if primary_image:
 | 
			
		||||
            image = ProductImage(
 | 
			
		||||
                product=product,
 | 
			
		||||
                image_url=primary_image
 | 
			
		||||
                image_url=primary_image[0]
 | 
			
		||||
            )
 | 
			
		||||
            return [image]
 | 
			
		||||
        product_images = []
 | 
			
		||||
@@ -84,7 +84,7 @@ class OzonProductSynchronizer(BaseProductSynchronizer):
 | 
			
		||||
            products_info = await self.api.get_products_info(data)
 | 
			
		||||
            if not products_info:
 | 
			
		||||
                continue
 | 
			
		||||
            result = products_info.get('result')
 | 
			
		||||
            result = products_info
 | 
			
		||||
            if not result:
 | 
			
		||||
                continue
 | 
			
		||||
            items = result.get('items')
 | 
			
		||||
@@ -131,7 +131,7 @@ class OzonProductSynchronizer(BaseProductSynchronizer):
 | 
			
		||||
            products_info = await self.api.get_products_info(data)
 | 
			
		||||
            if not products_info:
 | 
			
		||||
                continue
 | 
			
		||||
            result = products_info.get('result')
 | 
			
		||||
            result = products_info
 | 
			
		||||
            if not result:
 | 
			
		||||
                continue
 | 
			
		||||
            items = result.get('items')
 | 
			
		||||
@@ -169,6 +169,9 @@ class OzonProductSynchronizer(BaseProductSynchronizer):
 | 
			
		||||
    def _update_images(self, product, product_info):
 | 
			
		||||
        existing_images = {image.image_url for image in product.images}
 | 
			
		||||
        primary_image = product_info.get('primary_image')
 | 
			
		||||
        if isinstance(primary_image,list) and primary_image:
 | 
			
		||||
            primary_image = primary_image[0]
 | 
			
		||||
 | 
			
		||||
        if primary_image and primary_image not in existing_images:
 | 
			
		||||
            image = ProductImage(
 | 
			
		||||
                product=product,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user