From 03094b6d36c39687b324bb1726250efbc0ba110b Mon Sep 17 00:00:00 2001 From: Arylide Date: Mon, 2 Apr 2018 13:18:39 -0700 Subject: [PATCH] Commit editing time --- nyaa/templates/view.html | 2 +- nyaa/views/torrents.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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()