From 791656147efb9d2a3a9a33048c3cb8928ef06f47 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 4 Feb 2021 03:32:49 +0100 Subject: [PATCH] [Plugin] balance: Raise conflict if limit exceeded. --- flaschengeist/plugins/balance/balance_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaschengeist/plugins/balance/balance_controller.py b/flaschengeist/plugins/balance/balance_controller.py index f363855..19ed72e 100644 --- a/flaschengeist/plugins/balance/balance_controller.py +++ b/flaschengeist/plugins/balance/balance_controller.py @@ -80,7 +80,7 @@ def send(sender: User, receiver, amount: float, author: User): if (get_balance(sender)[2] - amount) < sender.get_attribute(__attribute_limit) and not author.has_permission( permissions.EXCEED_LIMIT ): - raise BadRequest("Limit exceeded") + raise Conflict("Limit exceeded") transaction = Transaction(sender_=sender, receiver_=receiver, amount=amount, author_=author) db.session.add(transaction)