From a4c89f1494d5f7d5b8b07a50d39bba2c871c46bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 20 Feb 2023 16:00:12 +0800 Subject: [PATCH] Added the type hint and the documentation for the obj parameter of the post_update method of the AccountForm and CurrencyForm forms. --- src/accounting/account/forms.py | 3 ++- src/accounting/currency/forms.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/accounting/account/forms.py b/src/accounting/account/forms.py index 752c7d8..733175e 100644 --- a/src/accounting/account/forms.py +++ b/src/accounting/account/forms.py @@ -96,9 +96,10 @@ class AccountForm(FlaskForm): setattr(self, "__post_update", lambda: sort_accounts_in(prev_base_code, obj.id)) - def post_update(self, obj) -> None: + def post_update(self, obj: Account) -> None: """The post-processing after the update. + :param obj: The account object. :return: None """ current_user_pk: int = get_current_user_pk() diff --git a/src/accounting/currency/forms.py b/src/accounting/currency/forms.py index 1f0bc3a..3dce475 100644 --- a/src/accounting/currency/forms.py +++ b/src/accounting/currency/forms.py @@ -83,9 +83,10 @@ class CurrencyForm(FlaskForm): obj.created_by_id = current_user_pk obj.updated_by_id = current_user_pk - def post_update(self, obj) -> None: + def post_update(self, obj: Currency) -> None: """The post-processing after the update. + :param obj: The currency object. :return: None """ current_user_pk: int = get_current_user_pk()