From c31b72bde29c875f72de17a2be739d69bcd0697b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 31 Mar 2020 21:40:23 +1100 Subject: [PATCH] type checking --- InvenTree/InvenTree/fields.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/fields.py b/InvenTree/InvenTree/fields.py index 7dbf953016..d2fb7b6ff4 100644 --- a/InvenTree/InvenTree/fields.py +++ b/InvenTree/InvenTree/fields.py @@ -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):