improvements to coop loader

This commit is contained in:
Sam
2021-02-26 13:16:37 +00:00
parent 874068881d
commit 25b8e561d3
3 changed files with 35 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ def create_imported_product(info, company, history, user):
# save using File object
img_io = BytesIO()
image.save(img_io, format=image.format)
new.image.save(f"{new.name}-{new.sku}.jpg", File(img_io), save=False)
new.image.save(f"{new.name}-{new.sku}.{image.format.lower()}", File(img_io), save=False)
new.save()
except AssertionError as e:
logging.error(f"Source image [{info['images'][0]['src']}] not reachable: {response.status_code}")