From 81659da9785217650a4e77d6276ed36574496c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gregor=20D=C3=BCster?= Date: Wed, 2 Oct 2024 12:49:13 +0200 Subject: [PATCH] Adjust unconfirmed transactions table id, author, date and amount are usually not of interest in the first place. --- web/blueprints/finance/__init__.py | 13 +------------ web/blueprints/finance/tables.py | 10 ++-------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/web/blueprints/finance/__init__.py b/web/blueprints/finance/__init__.py index 7cc554158..b93fdcd75 100644 --- a/web/blueprints/finance/__init__.py +++ b/web/blueprints/finance/__init__.py @@ -1181,13 +1181,13 @@ def _format_transaction_row( bank_acc_act: BankAccountActivity | None, ) -> UnconfirmedTransactionsRow: return UnconfirmedTransactionsRow( - id=transaction.id, description=LinkColResponse( href=url_for(".transactions_show", transaction_id=transaction.id), title=transaction.description, new_tab=True, glyphicon="fa-external-link-alt", ), + other_name=bank_acc_act.other_name if bank_acc_act else None, user=( LinkColResponse( href=url_for("user.user_show", user_id=user_account.user.id), @@ -1205,17 +1205,6 @@ def _format_transaction_row( if user_account and user_account.user and user_account.user.room else None ), - author=( - LinkColResponse( - href=url_for("user.user_show", user_id=transaction.author.id), - title=transaction.author.name, - new_tab=True, - ) - if transaction.author - else None - ), - date=date_format(transaction.posted_at, formatter=date_filter), - amount=money_filter(transaction.amount), actions=list(_iter_transaction_buttons(bank_acc_act, transaction)), ) diff --git a/web/blueprints/finance/tables.py b/web/blueprints/finance/tables.py index 955207a0f..549336692 100644 --- a/web/blueprints/finance/tables.py +++ b/web/blueprints/finance/tables.py @@ -306,24 +306,18 @@ class TransactionSplitResponse(TableResponse[TransactionSplitRow]): class UnconfirmedTransactionsTable(BootstrapTable): """A table for displaying unconfirmed transactions """ selection = Column("Checkbox", col_args={"data-checkbox": "true"}) - id = Column("id") description = LinkColumn("Beschreibung") + other_name = Column("Bankkontoinhaber") user = LinkColumn("Nutzer") room = Column("Wohnort") - date = DateColumn("Datum") - amount = Column("Wert") - author = LinkColumn("Ersteller") actions = MultiBtnColumn("Aktionen") class UnconfirmedTransactionsRow(BaseModel): - id: str | int description: LinkColResponse + other_name: str | None = None user: LinkColResponse | None = None room: str | None = None - date: DateColResponse - amount: str - author: LinkColResponse | None = None actions: list[BtnColResponse]