From 93376a5fbbc646690bef238e9e35dc3e863df2ec Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 8 Jan 2016 08:50:06 +0100 Subject: [PATCH] Issue 3543 - Webhooks: problem extracting the story points from a user story --- taiga/webhooks/signal_handlers.py | 5 +++-- tests/integration/test_webhooks.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/taiga/webhooks/signal_handlers.py b/taiga/webhooks/signal_handlers.py index b209681e..1b4db0a6 100644 --- a/taiga/webhooks/signal_handlers.py +++ b/taiga/webhooks/signal_handlers.py @@ -15,6 +15,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from django.db import connection from django.conf import settings from django.utils import timezone @@ -62,6 +63,6 @@ def on_new_history_entry(sender, instance, created, **kwargs): args = [webhook["id"], webhook["url"], webhook["key"], obj] + extra_args if settings.CELERY_ENABLED: - task.delay(*args) + connection.on_commit(lambda: task.delay(*args)) else: - task(*args) + connection.on_commit(lambda: task(*args)) diff --git a/tests/integration/test_webhooks.py b/tests/integration/test_webhooks.py index 2bfe689f..83ee4b28 100644 --- a/tests/integration/test_webhooks.py +++ b/tests/integration/test_webhooks.py @@ -23,7 +23,7 @@ from .. import factories as f from taiga.projects.history import services -pytestmark = pytest.mark.django_db +pytestmark = pytest.mark.django_db(transaction=True) def test_new_object_with_one_webhook(settings):