From 001d3fb82382123e74bdbae3ef5d6653bfeca8a7 Mon Sep 17 00:00:00 2001 From: Hendrik L Date: Tue, 3 Dec 2024 14:22:49 +0100 Subject: [PATCH] add flash warnings if banning admins --- app/user/routes.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/user/routes.py b/app/user/routes.py index e02830ea..5bc30c38 100644 --- a/app/user/routes.py +++ b/app/user/routes.py @@ -509,6 +509,10 @@ def ban_profile(actor): add_to_modlog('ban_user', link_text=user.display_name(), link=user.link()) + if user.is_instance_admin(): + flash('Banned user was a remote instance admin.', 'warning') + if user.is_admin() or user.is_staff(): + flash('Banned user with role permissions.', 'warning') flash(f'{actor} has been banned.') else: abort(401) @@ -700,6 +704,10 @@ def delete_profile(actor): add_to_modlog('delete_user', link_text=user.display_name(), link=user.link()) + if user.is_instance_admin(): + flash('Deleted user was a remote instance admin.', 'warning') + if user.is_admin() or user.is_staff(): + flash('Deleted user with role permissions.', 'warning') flash(f'{actor} has been deleted.') else: abort(401) @@ -816,6 +824,11 @@ def ban_purge_profile(actor): # todo: empty relevant caches + if user.is_instance_admin(): + flash('Purged user was a remote instance admin.', 'warning') + if user.is_admin() or user.is_staff(): + flash('Purged user with role permissions.', 'warning') + # federate deletion if user.is_local(): user.deleted_by = current_user.id