Minor changes

This commit is contained in:
JKuijperM 2026-07-27 16:49:37 +02:00
parent 88802360db
commit 166a0b8d18
2 changed files with 9 additions and 0 deletions

View File

@ -623,6 +623,15 @@ def account_edit(request, pk):
@login_required @login_required
def account_delete(request, pk): def account_delete(request, pk):
"""Delete an account via *soft-delete* (sets active=False).
Unlike expense_delete, tag_delete or income_delete, which delete the
record for real, accounts are never physically removed: they are
deactivated. Historical expenses and incomes keep their ForeignKey to
the account, so balances and charts for past periods remain correct.
An inactive account disappears from forms (querysets filtered by
active=True) but stays visible and dimmed in the account list.
"""
account = get_object_or_404(Account, pk=pk, owner=request.user) account = get_object_or_404(Account, pk=pk, owner=request.user)
if request.method == "POST": if request.method == "POST":

Binary file not shown.