Преглед на файлове

Raise NotRegistered in delay_task() if the task is not in the registry.

Ask Solem преди 16 години
родител
ревизия
fad3646d58
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      crunchy/task.py

+ 4 - 4
crunchy/task.py

@@ -5,10 +5,10 @@ from crunchy.discovery import autodiscover
 
 
 def delay_task(task_name, **kwargs):
-    #if task_name not in tasks:
-    #    raise tasks.NotRegistered(
-    #            "Task with name %s not registered in the task registry." % (
-    #                task_name))
+    if task_name not in tasks:
+        raise tasks.NotRegistered(
+                "Task with name %s not registered in the task registry." % (
+                    task_name))
     publisher = TaskPublisher(connection=DjangoAMQPConnection)
     task_id = publisher.delay_task(task_name, **kwargs)
     publisher.close()