Skip to content

Commit

Permalink
Empty strings skip validation only when the field allows them; replaces
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelacey committed Dec 8, 2021
1 parent 44d102a commit 50390c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worf/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def validate_bundle(self, key):
annotation.output_field if annotation else self.model._meta.get_field(key)
)

if field.blank and self.bundle[key] == "":
if field.blank and field.empty_strings_allowed and self.bundle[key] == "":
pass

elif field.null and self.bundle[key] is None:
Expand Down

0 comments on commit 50390c3

Please sign in to comment.