From 62e171c09a32e61aa5616c950a6fabef68232ae6 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Tue, 1 Nov 2022 03:54:02 -0500 Subject: [PATCH] fix mbux -> coins --- files/routes/users.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/routes/users.py b/files/routes/users.py index 3e6a57c94..0cc664c54 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -290,7 +290,12 @@ def transfer_currency(v:User, username:str, currency_name:Literal['coins', 'proc abort(400, f"You don't have enough {friendly_currency_name}") if not v.shadowbanned: - receiver.coins += amount - tax + if currency_name == 'procoins': + receiver.procoins += amount - tax + elif currency_name == 'coins': + receiver.coins += amount - tax + else: + raise ValueError(f"Invalid currency '{currency_name}' got when transferring {amount} from {v.id} to {receiver.id}") g.db.add(receiver) send_repeatable_notification(GIFT_NOTIF_ID, log_message) send_repeatable_notification(receiver.id, notif_text)