comments: skip already deleted comments and make sure we don't raise unnecessary errors.
This commit is contained in:
parent
62e22ad5de
commit
caee47148f
1 changed files with 5 additions and 0 deletions
|
|
@ -428,6 +428,11 @@ class ChangesetController(BaseRepoController):
|
|||
@jsonify
|
||||
def delete_comment(self, repo_name, comment_id):
|
||||
comment = ChangesetComment.get(comment_id)
|
||||
if not comment:
|
||||
log.debug('Comment with id:%s not found, skipping', comment_id)
|
||||
# comment already deleted in another call probably
|
||||
return True
|
||||
|
||||
owner = (comment.author.user_id == c.rhodecode_user.user_id)
|
||||
is_repo_admin = h.HasRepoPermissionAny('repository.admin')(c.repo_name)
|
||||
if h.HasPermissionAny('hg.admin')() or is_repo_admin or owner:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue