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(