Kaydet (Commit) 10884ec2 authored tarafından Karen Tracey's avatar Karen Tracey

Fixed #12239, again: Refined the original fix to avoid the test errors…

Fixed #12239, again: Refined the original fix to avoid the test errors introduced.  Thanks pmclanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 9150fb6b
......@@ -579,7 +579,7 @@ class CharField(Field):
def get_prep_value(self, value):
return self.to_python(value)
def formfield(self, **kwargs):
# Passing max_length to forms.CharField means that the value's length
# will be validated twice. This is considered acceptable since we want
......@@ -884,8 +884,9 @@ class IntegerField(Field):
return int(value)
def get_prep_lookup(self, lookup_type, value):
if lookup_type == 'gte' or lookup_type == 'lt':
value = math.ceil(value)
if (lookup_type == 'gte' or lookup_type == 'lt') \
and isinstance(value, float):
value = math.ceil(value)
return super(IntegerField, self).get_prep_lookup(lookup_type, value)
def get_internal_type(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment