From efe4e2e5178d2d6e6f710c3edee0d07cd6a60ab5 Mon Sep 17 00:00:00 2001 From: Karen Tracey Date: Sat, 12 Nov 2011 19:53:56 +0000 Subject: Fix #16570: Restore ability to have decimal fields where max_digits equals decimal_places. Thanks dcwatson and kenth. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17089 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/core/management/validation.py b/django/core/management/validation.py index 3cb2e345e8..3aaeaa94c8 100644 --- a/django/core/management/validation.py +++ b/django/core/management/validation.py @@ -72,9 +72,9 @@ def get_validation_errors(outfile, app=None): mdigits_ok = True except (ValueError, TypeError): e.add(opts, mdigits_msg % f.name) - invalid_values_msg = '"%s": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.' + invalid_values_msg = '"%s": DecimalFields require a "max_digits" attribute value that is greater than or equal to the value of the "decimal_places" attribute.' if decimalp_ok and mdigits_ok: - if decimal_places >= max_digits: + if decimal_places > max_digits: e.add(opts, invalid_values_msg % f.name) if isinstance(f, models.FileField) and not f.upload_to: e.add(opts, '"%s": FileFields require an "upload_to" attribute.' % f.name) -- cgit v1.3