Skip to content

Commit

Permalink
Connect Celery event handler to Event.fired automatically (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauk-slon authored Dec 21, 2022
1 parent 0ca09c5 commit 72647de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "dj-triggers"
version = "0.7.0"
version = "0.7.1"
description = ""
authors = []
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions tests/app/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ class BillingConfig(AppConfig):
verbose_name = _('Test app')

def ready(self):
from .celery import app
app.autodiscover_tasks(force=True)
# Initialize Celery app
from tests.app import celery # noqa: F401
1 change: 1 addition & 0 deletions triggers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'triggers.apps.DefaultConfig'
11 changes: 11 additions & 0 deletions triggers/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _


class DefaultConfig(AppConfig):
name = 'triggers'
verbose_name = _('Triggers')

def ready(self):
# Connect `triggers.tasks.on_event_fired` to `Event.fired` signal
from triggers import tasks # noqa: F401

0 comments on commit 72647de

Please sign in to comment.