From: Christian Heller Date: Wed, 22 Jan 2025 12:09:09 +0000 (+0100) Subject: Fix brokenness of individual-Booking view. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/decks/ledger?a=commitdiff_plain;h=8d84e13dccde81161fbab130b6d0d3fa8d855e29;p=plomledger Fix brokenness of individual-Booking view. --- diff --git a/ledger.py b/ledger.py index 51c722b..f2566bd 100755 --- a/ledger.py +++ b/ledger.py @@ -154,16 +154,15 @@ class Booking: # pylint: disable=too-few-public-methods def __init__(self, id_: int, dat_lines: list[DatLine]) -> None: - self.id_ = id_ dat_lines[0].booking_line = IntroLine(self, dat_lines[0].code) intro_line = dat_lines[0].booking_line transfer_lines = [] for dat_line in dat_lines[1:]: dat_line.booking_line = TransferLine(self, dat_line.code) transfer_lines += [dat_line.booking_line] + changes = Wealth() self.account_changes: dict[str, Wealth] = {} self.sink_account = None - changes = Wealth() for transfer_line in [tl for tl in transfer_lines if not tl.errors]: if transfer_line.account not in self.account_changes: self.account_changes[transfer_line.account] = Wealth() @@ -183,6 +182,8 @@ class Booking: for _ in [bl for bl in [intro_line] + transfer_lines if bl.errors]: self.questionable = True break + self.id_ = id_ + self.dat_lines = dat_lines class Handler(PlomHttpHandler):