From 90d32b1381bc1dbdadfc0d9bb0245d1c33061225 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 3 Sep 2022 23:45:32 +0200 Subject: [PATCH] fix marseybux gift reasons not appearing in /transfers --- files/routes/users.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index dcab2310ab..bd456ca483 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -478,12 +478,15 @@ def transfer_bux(v, username): if not v.shadowbanned: receiver.procoins += amount - log_message = f"@{v.username} has transferred {amount} Marseybux to @{receiver.username}" - send_repeatable_notification(GIFT_NOTIF_ID, log_message) + log_message = f"@{v.username} has transferred {amount} marseybux to @{receiver.username}" + notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount} marseybux!" - notif_text = f":marseycapitalistmanlet: @{v.username} has gifted you {amount} Marseybux!" if reason: + if len(reason) > 200: return {"error": "Reason is too long, max 200 characters"},400 notif_text += f"\n\n> {reason}" + log_message += f"\n\n> {reason}" + + send_repeatable_notification(GIFT_NOTIF_ID, log_message) send_repeatable_notification(receiver.id, notif_text) g.db.add(receiver)