Explorar el Código

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

Ask Solem hace 16 años
padre
commit
fad3646d58
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  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()