Changeset - 901a5f2f3530
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 7 years ago 2018-11-22 21:01:54
thomas.de_schampheleire@nokia.com
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.
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -253,11 +253,11 @@ def create_cs_pr_comment(repo_name, revi
 

	
 
    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 @@ class ChangesetController(BaseRepoContro
 
    @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')
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -641,4 +641,4 @@ class PullrequestsController(BaseRepoCon
 
    @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)
0 comments (0 inline, 0 general)