2e reviewed manuscript

This commit is contained in:
Luciano Ramalho
2021-11-12 11:33:12 -03:00
parent f5e3cb8ad3
commit 80f7f84274
32 changed files with 323 additions and 156 deletions

View File

@@ -30,7 +30,7 @@ class NonBlank(Validated):
def validate(self, name, value):
value = value.strip()
if len(value) == 0:
if not value: # <2>
raise ValueError(f'{name} cannot be blank')
return value # <2>
return value # <3>
# end::MODEL_V5_VALIDATED_SUB[]