Selaa lähdekoodia

Task Userguide: Fixed inconsistency in examples

Ask Solem 14 vuotta sitten
vanhempi
commit
fed0afa95e
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      docs/userguide/tasks.rst

+ 2 - 1
docs/userguide/tasks.rst

@@ -19,10 +19,11 @@ Given a function ``create_user``, that takes two arguments: ``username`` and
 .. code-block:: python
 .. code-block:: python
 
 
     from celery.task import Task
     from celery.task import Task
+    from django.contrib.auth import User
 
 
     class CreateUserTask(Task):
     class CreateUserTask(Task):
         def run(self, username, password):
         def run(self, username, password):
-            create_user(username, password)
+            User.objects.create(username=username, password=password)
 
 
 For convenience there is a shortcut decorator that turns any function into
 For convenience there is a shortcut decorator that turns any function into
 a task:
 a task: