summaryrefslogtreecommitdiff
path: root/django/core/management/validation.py
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2011-11-12 19:53:56 +0000
committerKaren Tracey <kmtracey@gmail.com>2011-11-12 19:53:56 +0000
commitefe4e2e5178d2d6e6f710c3edee0d07cd6a60ab5 (patch)
tree6fcce3c85a3108189fba49d2a4e1f84fdc077886 /django/core/management/validation.py
parent63ba472cc4a0ce34d28af74d11e8037a1b3d0f96 (diff)
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
Diffstat (limited to 'django/core/management/validation.py')
-rw-r--r--django/core/management/validation.py4
1 files changed, 2 insertions, 2 deletions
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)