From e20c3bdb6bea10d56e72d903952875da53cabd90 Mon Sep 17 00:00:00 2001 From: "A.Avenel" Date: Thu, 3 Nov 2011 13:33:11 +0100 Subject: [PATCH] Small fix in CommaDecimalField class --- budget/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/budget/forms.py b/budget/forms.py index 8db90be..f5c3fb5 100644 --- a/budget/forms.py +++ b/budget/forms.py @@ -48,7 +48,8 @@ def get_billform_for(project, set_default=True, **kwargs): class CommaDecimalField(DecimalField): """A class to deal with comma in Decimal Field""" def process_formdata(self, value): - value[0] = str(value[0]).replace(',', '.') + if value: + value[0] = str(value[0]).replace(',', '.') return super(CommaDecimalField, self).process_formdata(value)