Browse Source

Fix code examples in routing documentation (#3664)

* Fix duplicate argument names.

`kwargs` can only used once in the declaration.

* Fix duplicate argument names.
Michael Howitz 8 years ago
parent
commit
595273e435
2 changed files with 3 additions and 3 deletions
  1. 1 1
      docs/userguide/configuration.rst
  2. 2 2
      docs/userguide/routing.rst

+ 1 - 1
docs/userguide/configuration.rst

@@ -1363,7 +1363,7 @@ Where ``myapp.tasks.route_task`` could be:
 
 .. code-block:: python
 
-    def route_task(self, name, args, kwargs, options, task=None, **kwargs):
+    def route_task(self, name, args, kwargs, options, task=None, **kw):
             if task == 'celery.ping':
                 return {'queue': 'default'}
 

+ 2 - 2
docs/userguide/routing.rst

@@ -591,11 +591,11 @@ Routers
 A router is a function that decides the routing options for a task.
 
 All you need to define a new router is to define a function with
-the signature ``(name, args, kwargs, options, task=None, **kwargs)``:
+the signature ``(name, args, kwargs, options, task=None, **kw)``:
 
 .. code-block:: python
 
-    def route_task(name, args, kwargs, options, task=None, **kwargs):
+    def route_task(name, args, kwargs, options, task=None, **kw):
             if name == 'myapp.tasks.compress_video':
                 return {'exchange': 'video',
                         'exchange_type': 'topic',