File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -287,16 +287,17 @@ Here is the safe version:
287
287
Because we have to setup a callback to run after commit, the full functionality
288
288
of the :py:class: `TaskWrapper ` is not available with tasks decorated with
289
289
: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:
291
292
292
293
.. code-block :: python
293
294
294
295
def do_work (user_id ):
295
296
user = User.objects.get(pk = user_id)
296
297
...
297
298
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)
300
301
301
302
302
303
.. py :func :: on_commit_task(* args, ** kwargs)
You can’t perform that action at this time.
0 commit comments