From 7a5ba0503ae64a4c0cde77b82e945935a6e15a07 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 6 Nov 2021 17:36:19 -0500 Subject: [PATCH] Use products handler to get image URL --- tailbone/views/products.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index cc6a47ec..3b6f45f0 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -1067,23 +1067,7 @@ class ProductView(MasterView): product = kwargs['instance'] use_buefy = self.get_use_buefy() - # TODO: pretty sure this is no longer needed? guess we'll find out - # kwargs['image'] = False - - # maybe provide image URL for product; we prefer image from our DB if - # present, but otherwise a "POD" image URL can be attempted. - if product.image: - kwargs['image_url'] = self.request.route_url('products.image', uuid=product.uuid) - - elif product.upc: - if self.rattail_config.getbool('tailbone', 'products.show_pod_image', default=False): - # here we try to give a URL to a so-called "POD" image for the product - kwargs['image_url'] = pod.get_image_url(self.rattail_config, product.upc) - kwargs['image_path'] = pod.get_image_path(self.rattail_config, product.upc) - - # maybe use "image not found" placeholder image - if not kwargs.get('image_url'): - kwargs['image_url'] = self.request.static_url('tailbone:static/img/product.png') + kwargs['image_url'] = self.handler.get_image_url(product) # add price history, if user has access if self.rattail_config.versioning_enabled() and self.has_perm('versions'):