diff --git a/djtriggers/tasks.py b/djtriggers/tasks.py index d216fc8..7aae00e 100644 --- a/djtriggers/tasks.py +++ b/djtriggers/tasks.py @@ -3,6 +3,8 @@ from django.apps import apps +from .models import Trigger + logger = get_task_logger(__name__) @@ -21,4 +23,7 @@ def clean_triggers(): @shared_task def process_trigger(trigger_id, trigger_app_label, trigger_class, *args, **kwargs): - apps.get_model(trigger_app_label, trigger_class).objects.get(id=trigger_id).process(*args, **kwargs) + try: + apps.get_model(trigger_app_label, trigger_class).objects.get(id=trigger_id).process(*args, **kwargs) + except Trigger.DoesNotExist: + pass