From df1eefdcee3b50f9b550b73731d79e9d15ffcaee Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Aug 27 2018 08:38:39 +0000 Subject: Update the webhook test function to use celery Signed-off-by: Clement Verna --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 662005c..8c70d5e 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -1278,23 +1278,14 @@ def test_web_hook(repo, username=None, namespace=None): form = pagure.forms.ConfirmationForm() if form.validate_on_submit(): - if pagure.lib.REDIS: - pagure.lib.REDIS.publish( - "pagure.hook", - json.dumps( - { - "project": repo.fullname, - "topic": "Test.notification", - "msg": {"content": "Test message"}, - } - ), - ) - flask.flash("Notification triggered") - else: - flask.flash( - "Notification could not be sent as the web-hook server could " - "not be contacted" - ) + + pagure.lib.notify.log( + project=repo, + topic="Test.notification", + msg={"content": "Test message"}, + redis=True + ) + flask.flash("Notification triggered") return flask.redirect( flask.url_for(