Issues with ProductVariation.get_fullPrice

Issue #204 resolved
Anonymous created an issue

I encountered an issue when uploading Satchmo to Dreamhost using Python 2.4.1, I posted an issue on [ Satchmo Users]. which I thought I should follow up here.

Product.get_fullPrice does not always return a Decimal, which causes the ProductVariation.get_fullPrice method to issue a TypeError when concatenating decimal and string objects.

Funnily enough this runs fine using Python 2.5

Reported by MikeHowarth

Comments (5)

  1. Anonymous

    Using the interactive shell running Python 2.4

    from satchmo.product.models import ProductVariation variation = ProductVariation.objects.get(product=1) print variation.unit_price

    This will throw a type error:

    TypeError: cannot contatenate 'str' and 'Decimal' objects

    This is generated from the following line in ProductVariation.get_fullPrice.:

    return self.parent.product.unit_price + price_delta

    Following the code back to the Product object the root of the issue is probably in the get_qty_price or _get_qty_price methods not returning a Decimal object.

  2. Log in to comment