Skip to content

Commit

Permalink
Use lazy_join instead of string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasjuhrich committed May 28, 2024
1 parent 377b43a commit bcdf4fd
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions web/blueprints/finance/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bcdf4fd

Please sign in to comment.