Revised the type hint and the coding style of the NeedSomeCurrencies validator.
This commit is contained in:
parent
cbe7c6ca6d
commit
fadce244c5
@ -51,8 +51,7 @@ DATE_REQUIRED: DataRequired = DataRequired(
|
|||||||
class NeedSomeCurrencies:
|
class NeedSomeCurrencies:
|
||||||
"""The validator to check if there is any currency sub-form."""
|
"""The validator to check if there is any currency sub-form."""
|
||||||
|
|
||||||
def __call__(self, form: CurrencyForm, field: FieldList) \
|
def __call__(self, form: FlaskForm, field: FieldList) -> None:
|
||||||
-> None:
|
|
||||||
if len(field) == 0:
|
if len(field) == 0:
|
||||||
raise ValidationError(lazy_gettext(
|
raise ValidationError(lazy_gettext(
|
||||||
"Please add some currencies."))
|
"Please add some currencies."))
|
||||||
|
Loading…
Reference in New Issue
Block a user