From 37f7f233f5f30c28ea60a7fbc272ffd296e2dbe1 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 14 Mar 2014 17:20:31 +0100 Subject: Fixed #22272 -- Fixed regression in DecimalField when using decimal_places=0. Thanks to trac user merb for the report. --- django/db/models/fields/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 16a07002bc..dd88471d78 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -1379,9 +1379,9 @@ class DecimalField(Field): def deconstruct(self): name, path, args, kwargs = super(DecimalField, self).deconstruct() - if self.max_digits: + if self.max_digits is not None: kwargs['max_digits'] = self.max_digits - if self.decimal_places: + if self.decimal_places is not None: kwargs['decimal_places'] = self.decimal_places return name, path, args, kwargs -- cgit v1.3