Added the "is_modified" pseudo property to the Account data model, and applied it to the update_account view, to count the localized titles for modification.

This commit is contained in:
2023-02-07 11:14:15 +08:00
parent a78057a8c3
commit 5cf3cb1e11
2 changed files with 14 additions and 1 deletions

View File

@ -139,7 +139,7 @@ def update_account(account: Account) -> redirect:
account=account)))
with db.session.no_autoflush:
form.populate_obj(account)
if not db.session.is_modified(account):
if not account.is_modified:
flash(lazy_gettext("The account was not modified."), "success")
return redirect(inherit_next(url_for("accounting.account.detail",
account=account)))