Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
fix list length validator
Browse files Browse the repository at this point in the history
  • Loading branch information
the-infinity committed Aug 3, 2021
1 parent 2538758 commit 9f52d91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wtfjson/validators/ListLength.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ def __init__(self,
self.max_entries = max_entries

def __call__(self, value: Any, form: Union['ListInput', 'DictInput'], field: Field):
if len(value) < self.min_entries or (self.max_entries is not None and len(field.data) < self.max_entries):
if len(value) < self.min_entries or (self.max_entries is not None and len(value) > self.max_entries):
raise ValidationError(self.message)

0 comments on commit 9f52d91

Please sign in to comment.