conftypes: Fix minint/maxint validation in PercList.

This commit is contained in:
Florian Bruhin 2014-08-05 13:05:36 +02:00
parent 8402aa051a
commit 4dd4b465e2

View File

@ -486,12 +486,12 @@ class PercOrInt(BaseType):
intval = int(value)
except ValueError:
raise ValidationError(value, "must be integer or percentage!")
if self.minint is not None and intval < self.minint:
raise ValidationError(value, "must be {} or bigger!".format(
self.minint))
if self.maxint is not None and intval > self.maxint:
raise ValidationError(value, "must be {} or smaller!".format(
self.maxint))
if self.minint is not None and intval < self.minint:
raise ValidationError(value, "must be {} or bigger!".format(
self.minint))
if self.maxint is not None and intval > self.maxint:
raise ValidationError(value, "must be {} or smaller!".format(
self.maxint))
class Command(BaseType):