From ff3a2d0640a96f93afd8dff19a9524780c18f195 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 22 Aug 2021 19:32:14 +0200 Subject: [PATCH] fddf --- files/routes/admin.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index e510c2207..6febd4497 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -140,8 +140,16 @@ def monthly(v): kind=name )) + text = "You were given the following awards:\n\n" + + for key, value in grant_awards.items(): + text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n" + + send_notification(NOTIFICATIONS_ACCOUNT, user, text) + g.db.bulk_save_objects(_awards) + return {"message": "Monthly awards granted"} @@ -255,6 +263,14 @@ def badge_grant_post(v): g.db.bulk_save_objects(_awards) + text = "You were given the following awards:\n\n" + + for key, value in grant_awards.items(): + text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n" + + send_notification(NOTIFICATIONS_ACCOUNT, user, text) + + g.db.add(user) return redirect(user.url)