Skip to content

Commit ae2192a

Browse files
author
Joel Collins
committed
Manually marshal tasks view
1 parent bd4c5a6 commit ae2192a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/labthings/default_views/tasks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from flask import abort
22

33
from ..view import View
4+
from ..view.marshalling import marshal_with
45
from ..schema import TaskSchema
56

67
from .. import tasks
@@ -12,7 +13,7 @@ class TaskList(View):
1213

1314
def get(self):
1415
"""List of all session tasks"""
15-
return tasks.tasks()
16+
return self.schema.dump(tasks.tasks())
1617

1718

1819
class TaskView(View):
@@ -41,7 +42,7 @@ def get(self, task_id):
4142

4243
task = task_dict.get(task_id)
4344

44-
return task
45+
return self.schema.dump(task)
4546

4647
def delete(self, task_id):
4748
"""
@@ -58,4 +59,4 @@ def delete(self, task_id):
5859

5960
task.kill(block=True, timeout=3)
6061

61-
return task
62+
return self.schema.dump(task)

0 commit comments

Comments
 (0)