From e5b9009dc27943ce031d68cbc76b0beb355af98a Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 22 Feb 2023 19:00:38 +0200 Subject: [PATCH] notify users when their flair gets changed by jannies --- files/routes/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 6338c74d4..3e542009d 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -846,6 +846,13 @@ def admin_title_change(user_id, v): ) g.db.add(ma) + if user.flairchanged: + message = f"@{v.username} (a site admin) has locked your flair to `{user.customtitleplain}`." + else: + message = f"@{v.username} (a site admin) has changed your flair to `{user.customtitleplain}`. You can change it back in the settings." + + send_repeatable_notification(user.id, message) + return {"message": f"@{user.username}'s flair has been changed!"} @app.post("/ban_user/")