Let only a cost name the bank account
This commit is contained in:
1 parent
a8cd493594
commit
2f4e4fa713
1 file changed
+10
@@ -690,6 +690,16 @@ class SkuldHandler(BaseHTTPRequestHandler):
|
|||||||
raise ApiError(
|
raise ApiError(
|
||||||
400, "Forvaltningskostnad rører ingen parti.", "lot_picks"
|
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
|
previous = None
|
||||||
if tx_id is not None:
|
if tx_id is not None:
|
||||||
row = conn.execute(
|
row = conn.execute(
|
||||||
|
|||||||
Reference in new issue
Block a user