From c25173ed2cfdcd0d5d893d37608edddf14d10c8f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 21 2017 08:20:29 +0000 Subject: Add namespace support to the get_ticket_template endpoint in the internal API This will allow loading templates for namespaced project wanting to use that feature. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/internal/__init__.py b/pagure/internal/__init__.py index f092a68..40fc6ff 100644 --- a/pagure/internal/__init__.py +++ b/pagure/internal/__init__.py @@ -320,8 +320,10 @@ def get_pull_request_ready_branch(): @PV.route('//issue/template', methods=['POST']) +@PV.route('///issue/template', methods=['POST']) @PV.route('/fork///issue/template', methods=['POST']) -def get_ticket_template(repo, username=None): +@PV.route('/fork////issue/template', methods=['POST']) +def get_ticket_template(repo, namespace=None, username=None): """ Return the template asked for the specified project """ @@ -343,7 +345,8 @@ def get_ticket_template(repo, username=None): response.status_code = 400 return response - repo = pagure.get_authorized_project(pagure.SESSION, repo, user=username) + repo = pagure.get_authorized_project( + pagure.SESSION, repo, user=username, namespace=namespace) if repo is None: response = flask.jsonify({