mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
Fixed #5232 -- Fixed the validation of DecimalField so that the negative sign is not counted as a digit. Thanks, Andrew Durdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -423,7 +423,7 @@ class IsValidDecimal(object):
|
||||
except DecimalException:
|
||||
raise ValidationError, _("Please enter a valid decimal number.")
|
||||
|
||||
pieces = str(val).split('.')
|
||||
pieces = str(val).lstrip("-").split('.')
|
||||
decimals = (len(pieces) == 2) and len(pieces[1]) or 0
|
||||
digits = len(pieces[0])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user