|
@@ -19,11 +19,13 @@ class TaskManager(models.Manager):
|
|
|
def delete_expired(self):
|
|
|
self.get_all_expired().delete()
|
|
|
|
|
|
- def mark_as_done(self, task_id):
|
|
|
+ def mark_as_done(self, task_id, result):
|
|
|
task, created = self.get_or_create(task_id=task_id, defaults={
|
|
|
- "is_done": True})
|
|
|
+ "status": "DONE",
|
|
|
+ "result": result})
|
|
|
if not created:
|
|
|
- task.is_done = True
|
|
|
+ task.status = "DONE"
|
|
|
+ task.result = result
|
|
|
task.save()
|
|
|
|
|
|
|