From 00872c3611530319247ae5945bc16ff94ab8ecd5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 14 2015 16:08:53 +0000 Subject: Be consistent on how we access the PR of the comment, check its status and coding style --- diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 73917e5..ddb3e6d 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -557,14 +557,14 @@ def pull_request_edit_comment(repo, requestid, commentid, username=None): comment = pagure.lib.get_request_comment( SESSION, request.uid, commentid) - if comment is None or comment.pull_request.project != project: + + if comment is None or comment.parent.project != project: flask.abort(404, 'Comment not found') if (flask.g.fas_user.username != comment.user.username - or comment.parent.status is False) \ + or comment.parent.status != 'Open') \ and not is_repo_admin(project): - flask.abort(403, - "You are not allowed to edit the comment") + flask.abort(403, 'You are not allowed to edit the comment') form = pagure.forms.EditCommentForm()