[Plugin] balance: Raise conflict if limit exceeded.

This commit is contained in:
Ferdinand Thiessen 2021-02-04 03:32:49 +01:00
parent 2daa79ee15
commit 791656147e
1 changed files with 1 additions and 1 deletions

View File

@ -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)