fix: added default product image, removed empty tables prints, fixed barcode output
This commit is contained in:
@@ -1027,7 +1027,14 @@ class DealService(BaseService):
|
||||
general_services_total = sum((service.price * service.quantity for service in deal.services))
|
||||
product_services_totals = await self._get_product_services_totals(deal)
|
||||
template = ENV.get_template("deal.html")
|
||||
product_images = await fetch_images([product.product.images[0].image_url for product in deal.products])
|
||||
|
||||
product_urls: List[Optional[str]] = []
|
||||
for product in deal.products:
|
||||
if len(product.product.images) > 0:
|
||||
product_urls.append(product.product.images[0].image_url)
|
||||
else:
|
||||
product_urls.append(None)
|
||||
product_images = await fetch_images(product_urls)
|
||||
|
||||
result = template.render({
|
||||
"general_services_total": general_services_total,
|
||||
|
||||
Reference in New Issue
Block a user