diefenbach / django-lfs

An online-shop based on Django
http://www.getlfs.com
BSD 3-Clause "New" or "Revised" License
622 stars 222 forks source link

Locale issue with get_clean_quantity_* methods #127

Closed emilian closed 11 years ago

emilian commented 11 years ago

The get_cleanquantity* methods on the product model use the locale.atof method in order to clean up the incoming quantity. However, float fields are stored in PostgreSQL as "1.0" regardless of the locale settings on the server. So if you pass in "1.0" to the get_clean_quantity_value() method (from a Django model such as CartItem.amount), it will return "10.0" if you are using a European locale.

Here is a screen shot to make it easier to understand:

http://screencast.com/t/kPDzLBxxO11

pigletto commented 11 years ago

should be fixed now with: commit 8fffd11982657f21b70c79f629947c0a99d3e2a9