TheGU / python-money

Automatically exported from code.google.com/p/python-money
0 stars 0 forks source link

Invalid literal for Decimal: '' #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using django-cashflow to create new account.

What is the expected output? What do you see instead?
Expected: Create successfully.
Real: decimal.InvalidOperation: Invalid literal for Decimal: ''

What version of the product are you using? On what operating system?
contrib.Money r5
Ubuntu 8.10

Solution: in Money.py:
115     def __eq__(self, other):
116         if isinstance(other, Money):
117             return (self.amount == other.amount) and (self.currency ==
other.currency)
118         #return (self.amount == Decimal(str(other)))
119         return (self.amount == Decimal(str(other or 0))) # use it
instead to avoid error when other=''

Original issue reported on code.google.com by tuanope...@gmail.com on 31 May 2009 at 4:01

GoogleCodeExporter commented 9 years ago
I update the version info:
python-money r25 (checked out today May/31/2009)

Original comment by tuanope...@gmail.com on 31 May 2009 at 4:03