Changeset - 5095f484f74c
[Not reviewed]
default
0 1 0
Mads Kiilerich - 12 years ago 2013-12-10 19:30:37
madski@unity3d.com
changeset: don't crash if removed comment already has been removed
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -425,12 +425,14 @@ class ChangesetController(BaseRepoContro
 
    @NotAnonymous()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    @jsonify
 
    def delete_comment(self, repo_name, comment_id):
 
        co = ChangesetComment.get(comment_id)
 
        if not co:
 
            raise HTTPBadRequest()
 
        owner = co.author.user_id == c.authuser.user_id
 
        repo_admin = h.HasRepoPermissionAny('repository.admin')
 
        if h.HasPermissionAny('hg.admin')() or repo_admin or owner:
 
            ChangesetCommentsModel().delete(comment=co)
 
            Session().commit()
 
            return True
0 comments (0 inline, 0 general)