From 2f4e4fa713291ffe6512b59b9002062b035f29e3 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 18:31:13 +0000 Subject: [PATCH] Let only a cost name the bank account --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index ff0c200..b139008 100644 --- a/app.py +++ b/app.py @@ -690,6 +690,16 @@ class SkuldHandler(BaseHTTPRequestHandler): raise ApiError( 400, "Forvaltningskostnad rører ingen parti.", "lot_picks" ) + if tx["type"] != "admin_cost": + # The bank is only the counterparty of a cost (section 3.11). + bank_id = _bank_market_id(conn) + for field in ("market_id", "to_market_id"): + if tx[field] == bank_id: + raise ApiError( + 400, + "Bankkontoen kan berre brukast av forvaltningskostnad.", + field, + ) previous = None if tx_id is not None: row = conn.execute(