python: Fix model maxLength validation error message

This commit is contained in:
Ville Skyttä 2016-09-06 14:49:00 +03:00
parent ddc5b80438
commit f436f0eee2
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ class {{classname}}(object):
raise ValueError("Invalid value for `{{name}}`, must not be `None`") raise ValueError("Invalid value for `{{name}}`, must not be `None`")
{{#maxLength}} {{#maxLength}}
if len({{name}}) > {{maxLength}}: if len({{name}}) > {{maxLength}}:
raise ValueError("Invalid value for `{{name}}`, length must be less than `{{maxLength}}`") raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`")
{{/maxLength}} {{/maxLength}}
{{#minLength}} {{#minLength}}
if len({{name}}) < {{minLength}}: if len({{name}}) < {{minLength}}:

View File

@ -428,7 +428,7 @@ class FormatTest(object):
if not password: if not password:
raise ValueError("Invalid value for `password`, must not be `None`") raise ValueError("Invalid value for `password`, must not be `None`")
if len(password) > 64: if len(password) > 64:
raise ValueError("Invalid value for `password`, length must be less than `64`") raise ValueError("Invalid value for `password`, length must be less than or equal to `64`")
if len(password) < 10: if len(password) < 10:
raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`")