main_image broken when product has no images and is not a variation

Issue #120 resolved
Anonymous created an issue

In the case when a product has no images and has no parent (is not a ProductVariation), _get_mainImage raises an uncaught exception and fails to return the default image.

The cause is that the line "parent = self.productvariation.parent" raises ProductVariation.DoesNotExist - but the code tries to catch Product.DoesNotExist.

The attached one-line patch fixes this.

Reported by itai

Comments (2)

  1. Log in to comment