diff --git a/nyaa/templates/view.html b/nyaa/templates/view.html index 08e00e1..ffad138 100644 --- a/nyaa/templates/view.html +++ b/nyaa/templates/view.html @@ -162,7 +162,7 @@ {% if g.user.id == comment.user_id and not comment.editing_limit_exceeded and (not torrent.comment_locked or comment_form) %} {% endif %} - {% if g.user.is_superadmin or (g.user.id == comment.user_id and not torrent.comment_locked) %} + {% if g.user.is_superadmin or (g.user.id == comment.user_id and not torrent.comment_locked and not comment.editing_limit_exceeded) %}
diff --git a/nyaa/views/torrents.py b/nyaa/views/torrents.py index b8c6c3e..1503e09 100644 --- a/nyaa/views/torrents.py +++ b/nyaa/views/torrents.py @@ -386,6 +386,9 @@ def delete_comment(torrent_id, comment_id): if torrent.comment_locked and not flask.g.user.is_moderator: flask.abort(403) + if comment.editing_limit_exceeded and not flask.g.user.is_superadmin: + flask.abort(403) + db.session.delete(comment) db.session.flush() torrent.update_comment_count()