Fix HTML escaping bug when rendering products with pack price

This commit is contained in:
Lance Edgar 2019-03-27 19:42:44 -05:00
parent d20d22ffb6
commit e9c9772c58

View file

@ -451,10 +451,10 @@ class ProductsView(MasterView):
if not product.not_for_sale: if not product.not_for_sale:
if price.price is not None and price.pack_price is not None: if price.price is not None and price.pack_price is not None:
if price.multiple > 1: if price.multiple > 1:
return HTML("$ {:0.2f} / {}  ($ {:0.2f} / {})".format( return HTML.literal("$ {:0.2f} / {}  ($ {:0.2f} / {})".format(
price.price, price.multiple, price.price, price.multiple,
price.pack_price, price.pack_multiple)) price.pack_price, price.pack_multiple))
return HTML("$ {:0.2f}  ($ {:0.2f} / {})".format( return HTML.literal("$ {:0.2f}  ($ {:0.2f} / {})".format(
price.price, price.pack_price, price.pack_multiple)) price.price, price.pack_price, price.pack_multiple))
if price.price is not None: if price.price is not None:
if price.multiple is not None and price.multiple > 1: if price.multiple is not None and price.multiple > 1: