type checking

This commit is contained in:
Oliver Walters 2020-03-31 21:40:23 +11:00
parent 6919eaa1e1
commit c31b72bde2

View File

@ -52,7 +52,10 @@ class RoundingDecimalFormField(forms.DecimalField):
Why? It looks nice!
"""
return value.normalize()
if type(value) == Decimal:
return value.normalize()
else:
return value
class RoundingDecimalField(models.DecimalField):