diff --git a/pagure/templates/_formhelper.html b/pagure/templates/_formhelper.html index 14ae352..d05ce61 100644 --- a/pagure/templates/_formhelper.html +++ b/pagure/templates/_formhelper.html @@ -62,7 +62,7 @@ {% endmacro %} -{% macro show_comment(comment, id, repo, username, issueid, form) %} +{% macro show_comment(comment, id, repo, username, issueid, form, repo_admin) %}
{{ comment.user.user | avatar(16) | safe }} @@ -76,9 +76,10 @@ reply {% if id != 0 and g.fas_user and ( - g.fas_user.username == comment.user.username or repo_admin) %} + (comment.parent.status == True and g.fas_user.username == comment.user.username) + or repo_admin) %} diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index bc70d6c..8aa938a 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -99,7 +99,7 @@ {% if issue.comments %} {% for comment in issue.comments %} - {{ show_comment(comment, loop.index, repo, username, issueid, form) }} + {{ show_comment(comment, loop.index, repo, username, issueid, form, repo_admin) }} {% endfor %} {% endif %} diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 2327091..a413efa 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -208,7 +208,7 @@ {% for comment in pull_request.discussion %} {% if not comment.commit_id %} - {{ show_comment(comment, loop.index, repo, username, requestid, form) }} + {{ show_comment(comment, loop.index, repo, username, requestid, form, repo_admin) }} {% endif %} {% endfor %} {{ mergeform.csrf_token }} diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index 1b9ee76..49720f2 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -144,8 +144,9 @@ def format_loc(loc, commit=None, filename=None, prequest=None, index=None): templ_delete = '' if authenticated() and \ - (comment.user.user == flask.g.fas_user.username or - is_repo_admin(comment.pull_request.repo)): + ((comment.parent.status == True + and comment.user.user == flask.g.fas_user.username) + or is_repo_admin(comment.parent.repo)): templ_delete = tpl_delete % ({'commentid': comment.id}) output.append(