From 8637aad86de3478470614583452d369996ef9542 Mon Sep 17 00:00:00 2001 From: Tim Flink Date: May 26 2017 17:11:51 +0000 Subject: [PATCH 1/2] changing logic order to avoid error with no ci. Fixes #2312 --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index d10f775..5a8fb76 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1518,7 +1518,7 @@ def new_pull_request(session, branch_from, ) # Send notification to the CI server - if REDIS and request.project.ci_hook and PAGURE_CI \ + if REDIS and PAGURE_CI and request.project.ci_hook \ and not request.project.private: REDIS.publish('pagure.ci', json.dumps({ 'ci_type': request.project.ci_hook.ci_type, From 3f54217475a28250069c41fb8496afea5d54c129 Mon Sep 17 00:00:00 2001 From: Tim Flink Date: May 26 2017 19:02:00 +0000 Subject: [PATCH 2/2] changing order for other PAGURE_CI comparisons --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 5a8fb76..026a77a 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1134,7 +1134,7 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, # Send notification to the CI server, if the comment added was a # notification and the PR is still open and project is not private if notification and request.status == 'Open' \ - and request.project.ci_hook and PAGURE_CI \ + and PAGURE_CI and request.project.ci_hook\ and not request.project.private: REDIS.publish('pagure.ci', json.dumps({ 'ci_type': request.project.ci_hook.ci_type, @@ -1153,7 +1153,7 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, if trigger_ci and comment.strip().lower() in trigger_ci: # Send notification to the CI server - if REDIS and request.project.ci_hook and PAGURE_CI: + if REDIS and PAGURE_CI and request.project.ci_hook: REDIS.publish('pagure.ci', json.dumps({ 'ci_type': request.project.ci_hook.ci_type, 'pr': request.to_json(public=True, with_comments=False)