mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
add flash warnings if banning admins
This commit is contained in:
parent
6e8f7c57cb
commit
001d3fb823
1 changed files with 13 additions and 0 deletions
|
@ -509,6 +509,10 @@ def ban_profile(actor):
|
||||||
|
|
||||||
add_to_modlog('ban_user', link_text=user.display_name(), link=user.link())
|
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.')
|
flash(f'{actor} has been banned.')
|
||||||
else:
|
else:
|
||||||
abort(401)
|
abort(401)
|
||||||
|
@ -700,6 +704,10 @@ def delete_profile(actor):
|
||||||
|
|
||||||
add_to_modlog('delete_user', link_text=user.display_name(), link=user.link())
|
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.')
|
flash(f'{actor} has been deleted.')
|
||||||
else:
|
else:
|
||||||
abort(401)
|
abort(401)
|
||||||
|
@ -816,6 +824,11 @@ def ban_purge_profile(actor):
|
||||||
|
|
||||||
# todo: empty relevant caches
|
# 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
|
# federate deletion
|
||||||
if user.is_local():
|
if user.is_local():
|
||||||
user.deleted_by = current_user.id
|
user.deleted_by = current_user.id
|
||||||
|
|
Loading…
Add table
Reference in a new issue