Set min_length=1 when allow_blank=False (#112)
This commit is contained in:
committed by
Cristi Vîjdea
parent
209201b9a5
commit
5b225423ae
@@ -281,6 +281,10 @@ def find_limits(field):
|
||||
if attr not in limits or improves(limit_value, limits[attr]):
|
||||
limits[attr] = limit_value
|
||||
|
||||
if hasattr(field, "allow_blank") and not field.allow_blank:
|
||||
if limits.get('min_length', 0) < 1:
|
||||
limits['min_length'] = 1
|
||||
|
||||
return OrderedDict(sorted(limits.items()))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user