Only show deprecation warning if the webhook is active

This commit is contained in:
Robin Ward
2019-06-10 16:22:51 -04:00
parent ace6ce0462
commit ecebff5060
2 changed files with 5 additions and 5 deletions

View File

@ -58,11 +58,11 @@ class WebHook < ActiveRecord::Base
end
def self.enqueue_object_hooks(type, object, event, serializer = nil)
if type == :flag
Discourse.deprecate("The flags webhook is deprecated. Please use reviewable instead.")
end
if active_web_hooks(type).exists?
if type == :flag
Discourse.deprecate("The flags webhook is deprecated. Please use reviewable instead.")
end
payload = WebHook.generate_payload(type, object, serializer)
WebHook.enqueue_hooks(type, event,