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)