Revised the type hint and the coding style of the NeedSomeCurrencies validator.

This commit is contained in:
依瑪貓 2023-03-14 20:43:28 +08:00
parent cbe7c6ca6d
commit fadce244c5

View File

@ -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."))