mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
show who deleted a post
This commit is contained in:
parent
051d0458d7
commit
c8fdf7c205
1 changed files with 8 additions and 2 deletions
|
@ -44,7 +44,10 @@ def show_post(post_id: int):
|
||||||
if current_user.is_anonymous or not (current_user.is_authenticated and (current_user.is_admin() or current_user.is_staff())):
|
if current_user.is_anonymous or not (current_user.is_authenticated and (current_user.is_admin() or current_user.is_staff())):
|
||||||
abort(404)
|
abort(404)
|
||||||
else:
|
else:
|
||||||
flash(_('This post has been deleted and is only visible to staff and admins.'), 'warning')
|
if post.deleted_by == post.user_id:
|
||||||
|
flash(_('This post has been deleted by the author and is only visible to staff and admins.'), 'warning')
|
||||||
|
else:
|
||||||
|
flash(_('This post has been deleted and is only visible to staff and admins.'), 'warning')
|
||||||
|
|
||||||
sort = request.args.get('sort', 'hot')
|
sort = request.args.get('sort', 'hot')
|
||||||
|
|
||||||
|
@ -390,7 +393,10 @@ def continue_discussion(post_id, comment_id):
|
||||||
if current_user.is_anonymous or not (current_user.is_authenticated and (current_user.is_admin() or current_user.is_staff())):
|
if current_user.is_anonymous or not (current_user.is_authenticated and (current_user.is_admin() or current_user.is_staff())):
|
||||||
abort(404)
|
abort(404)
|
||||||
else:
|
else:
|
||||||
flash(_('This comment has been deleted and is only visible to staff and admins.'), 'warning')
|
if post.deleted_by == post.user_id:
|
||||||
|
flash(_('This post has been deleted by the author and is only visible to staff and admins.'), 'warning')
|
||||||
|
else:
|
||||||
|
flash(_('This post has been deleted and is only visible to staff and admins.'), 'warning')
|
||||||
|
|
||||||
mods = post.community.moderators()
|
mods = post.community.moderators()
|
||||||
is_moderator = current_user.is_authenticated and any(mod.user_id == current_user.id for mod in mods)
|
is_moderator = current_user.is_authenticated and any(mod.user_id == current_user.id for mod in mods)
|
||||||
|
|
Loading…
Add table
Reference in a new issue