Merge "Don't add MaxStrLen validator if AllowedValues applied"
This commit is contained in:
commit
fb8d17bc6b
|
@ -122,7 +122,9 @@ class Field(object):
|
|||
if issubclass(self.field_class, fields.StringField):
|
||||
# check if fields is string
|
||||
if not any(isinstance(v, val_lib.MaxStrLen)
|
||||
for v in self.validators):
|
||||
for v in self.validators) and \
|
||||
not any(isinstance(v, val_lib.AllowedValues)
|
||||
for v in self.validators):
|
||||
default.append(val_lib.MaxStrLen(255))
|
||||
return default
|
||||
|
||||
|
|
|
@ -144,7 +144,6 @@ fixture_base_props = {
|
|||
u'enum': [u'private', u'public'],
|
||||
u'filter_ops': [u'eq', u'neq', u'in'],
|
||||
u'glareType': u'String',
|
||||
u'maxLength': 255,
|
||||
u'sortable': True,
|
||||
u'type': u'string'}
|
||||
}
|
||||
|
@ -621,7 +620,6 @@ fixtures = {
|
|||
u'neq',
|
||||
u'in'],
|
||||
u'glareType': u'String',
|
||||
u'maxLength': 255,
|
||||
u'type': [u'string',
|
||||
u'null']}
|
||||
}),
|
||||
|
@ -658,7 +656,6 @@ fixtures = {
|
|||
u'neq',
|
||||
u'in'],
|
||||
u'glareType': u'String',
|
||||
u'maxLength': 255,
|
||||
u'type': [u'string',
|
||||
u'null']},
|
||||
|
||||
|
@ -678,7 +675,6 @@ fixtures = {
|
|||
u'neq',
|
||||
u'in'],
|
||||
u'glareType': u'String',
|
||||
u'maxLength': 255,
|
||||
u'type': [u'string', u'null']},
|
||||
u'image': {u'additionalProperties': False,
|
||||
u'description': u'Image binary.',
|
||||
|
|
Loading…
Reference in New Issue