Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions formalchemy/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def length(min=0, max=None):
max_ = max
def f(value, field=None):
if len(value) < min_:
raise ValidationError(_('Value must be at least %(min)d characters long') % {'min': min_})
raise ValidationError(_('Value must be at least {0} characters long').format(min_))
if max_ is not None and len(value) > max_:
raise ValidationError(_('Value must be no more than %(max)d characters long') % {'max': max_})
raise ValidationError(_('Value must be no more than {0} characters long').format(max_))
return f

def maxlength(max):
Expand Down