changeset 7434:901a5f2f3530

controllers: remove pr_comment flag in delete_cs_pr_comment A separate comment is not really needed as we can check co.pull_request. Suggested by Mads Killerich.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Thu, 22 Nov 2018 21:01:54 +0100
parents 68f2eb1bec8c
children 2c54a82aeaed
files kallithea/controllers/changeset.py kallithea/controllers/pullrequests.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Sat Nov 17 21:31:08 2018 +0100
+++ b/kallithea/controllers/changeset.py	Thu Nov 22 21:01:54 2018 +0100
@@ -253,11 +253,11 @@
 
     return data
 
-def delete_cs_pr_comment(repo_name, comment_id, pr_comment=False):
+def delete_cs_pr_comment(repo_name, comment_id):
     co = ChangesetComment.get_or_404(comment_id)
     if co.repo.repo_name != repo_name:
         raise HTTPNotFound()
-    if pr_comment and co.pull_request.is_closed():
+    if co.pull_request and co.pull_request.is_closed():
         # don't allow deleting comments on closed pull request
         raise HTTPForbidden()
 
@@ -438,7 +438,7 @@
     @HasRepoPermissionLevelDecorator('read')
     @jsonify
     def delete_comment(self, repo_name, comment_id):
-        return delete_cs_pr_comment(repo_name, comment_id, pr_comment=False)
+        return delete_cs_pr_comment(repo_name, comment_id)
 
     @LoginRequired(allow_default_user=True)
     @HasRepoPermissionLevelDecorator('read')
--- a/kallithea/controllers/pullrequests.py	Sat Nov 17 21:31:08 2018 +0100
+++ b/kallithea/controllers/pullrequests.py	Thu Nov 22 21:01:54 2018 +0100
@@ -641,4 +641,4 @@
     @HasRepoPermissionLevelDecorator('read')
     @jsonify
     def delete_comment(self, repo_name, comment_id):
-        return delete_cs_pr_comment(repo_name, comment_id, pr_comment=True)
+        return delete_cs_pr_comment(repo_name, comment_id)