1. Chris Moffitt
  2. satchmo
Issue #204 resolved

Issues with ProductVariation.get_fullPrice

Anonymous created an issue

I encountered an issue when uploading Satchmo to Dreamhost using Python 2.4.1, I posted an issue on [http://groups.google.com/group/satchmo-users/browse_thread/thread/2ec1d1f438266ec9 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