From bcdf4fdf3aa9306b710ce3671d72d6a7c516cfd0 Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Tue, 28 May 2024 18:15:54 +0200 Subject: [PATCH] Use `lazy_join` instead of string concatenation --- web/blueprints/finance/tables.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/web/blueprints/finance/tables.py b/web/blueprints/finance/tables.py index 59c3d7702..9e3897154 100644 --- a/web/blueprints/finance/tables.py +++ b/web/blueprints/finance/tables.py @@ -249,22 +249,20 @@ def __init__(self, *, finance_change: bool = False, **kw: t.Any) -> None: super().__init__(**kw) @property - def toolbar(self) -> HasDunderStr | None: + @lazy_join + def toolbar(self) -> t.Iterator[str] | None: """Do operations on BankAccountActivities""" if not self.finance_change: return None - return str( - button_toolbar( - "Kontobewegungen zuordnen", - url_for(".bank_account_activities_match"), - icon="fa-check", - ) - ) + str( - button_toolbar( - "Kontobewegungen rücküberweisen", - url_for(".bank_account_activities_return"), - icon="fa-rotate-left", - ) + yield from button_toolbar( + "Kontobewegungen zuordnen", + url_for(".bank_account_activities_match"), + icon="fa-check", + ) + yield from button_toolbar( + "Kontobewegungen rücküberweisen", + url_for(".bank_account_activities_return"), + icon="fa-rotate-left", ) class Meta: