Merge pull request #1 from AdmanTIC/fixes/1016

Add default webhook configuration if absent from project
This commit is contained in:
Benjamin MALYNOVYTCH
2017-09-21 10:31:02 +02:00
committed by GitHub

View File

@@ -15,6 +15,7 @@ module RedmineWebhook
controller = context[:controller]
project = issue.project
webhooks = Webhook.where(:project_id => project.project.id)
webhooks = Webhook.where(:project_id => 0) unless webhooks
return unless webhooks
post(webhooks, issue_to_json(issue, controller))
end
@@ -26,6 +27,7 @@ module RedmineWebhook
issue = context[:issue]
project = issue.project
webhooks = Webhook.where(:project_id => project.project.id)
webhooks = Webhook.where(:project_id => 0) unless webhooks
return unless webhooks
post(webhooks, journal_to_json(issue, journal, controller))
end