From 880eeb3d4cdeb5d5276770f9ce1cbdf648744759 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 26 2015 10:52:10 +0000 Subject: Adjust the pull_request_add_comment endpoint Add support for making comments on the pull-request itself (not on a commit of the pull-request) --- diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index b0a6e37..e35fb80 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -245,12 +245,17 @@ def request_pull_patch(repo, requestid, username=None): return flask.Response(patch, content_type="text/plain;charset=UTF-8") +@APP.route('//request-pull//comment/', + methods=['POST']) @APP.route('//request-pull//comment//' '/', methods=('GET', 'POST')) +@APP.route('/fork///request-pull//comment/', + methods=['POST']) @APP.route('/fork///request-pull//comment/' '//', methods=('GET', 'POST')) -def pull_request_add_comment(repo, requestid, commit, filename, row, - username=None): +def pull_request_add_comment( + repo, requestid, commit=None, + filename=None, row=None, username=None): """ Add a comment to a commit in a pull-request. """ repo = pagure.lib.get_project(SESSION, repo, user=username)