Skip to content

Commit 5da909a

Browse files
authored
Merge pull request #829 from vspiespro/patch-1
Update django.rst
2 parents 327854c + 8902282 commit 5da909a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/django.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,17 @@ Here is the safe version:
287287
Because we have to setup a callback to run after commit, the full functionality
288288
of the :py:class:`TaskWrapper` is not available with tasks decorated with
289289
:py:func:`on_commit_task`. If you anticipate needing all the TaskWrapper
290-
methods, you can decorate the same function twice:
290+
methods, you can decorate the same function twice by given them two different
291+
identifier names:
291292

292293
.. code-block:: python
293294
294295
def do_work(user_id):
295296
user = User.objects.get(pk=user_id)
296297
...
297298
298-
do_work_task = task()(do_work)
299-
do_work_on_commit = on_commit_task()(do_work)
299+
do_work_task = task(name="do_work_task")(do_work)
300+
do_work_on_commit = on_commit_task(name="do_work_on_commit")(do_work)
300301
301302
302303
.. py:func:: on_commit_task(*args, **kwargs)

0 commit comments

Comments
 (0)