Applied the delete method of the Account data model to the delete_account view, to make things easier.
This commit is contained in:
parent
570c84c196
commit
d78b941674
@ -159,9 +159,7 @@ def delete_account(account: Account) -> redirect:
|
||||
:return: The redirection to the account list on success, or the account
|
||||
detail on error.
|
||||
"""
|
||||
for l10n in account.l10n:
|
||||
db.session.delete(l10n)
|
||||
db.session.delete(account)
|
||||
account.delete()
|
||||
sort_accounts_in(account.base_code, account.id)
|
||||
db.session.commit()
|
||||
flash(lazy_gettext("The account is deleted successfully."), "success")
|
||||
|
Loading…
Reference in New Issue
Block a user