From e7328ab98cc234fd079f333ef7ad363ee18a5eec Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 29 2017 12:52:52 +0000 Subject: Fix the JS retrieving the issues on the comment_update template When issues are globally turned off, this endpoint does not exist and therefore compiling the template fails. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/comment_update.html b/pagure/templates/comment_update.html index a015cb1..2220c36 100644 --- a/pagure/templates/comment_update.html +++ b/pagure/templates/comment_update.html @@ -44,8 +44,11 @@ } $("#update_comment").atwho(userConfig); }); - $.when($.get("{{ url_for('api_ns.api_view_issues', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}"), - $.get("{{ url_for('api_ns.api_pull_request_views', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}") + $.when( + {% if config.get('ENABLE_TICKETS', True) %} + $.get("{{ url_for('api_ns.api_view_issues', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}"), + {% endif %} + $.get("{{ url_for('api_ns.api_pull_request_views', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}") ).done(function(issuesResp, prResp) { // 0 is the api response var issuesAndPrs = issuesResp[0]['issues'].concat(prResp[0]['requests']);