File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/labthings/default_views Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 9
9
10
10
class TaskList (View ):
11
11
tags = ["tasks" ]
12
- schema = TaskSchema (many = True )
13
12
14
13
def get (self ):
15
14
"""List of all session tasks"""
16
- return self . schema .dump (tasks .tasks ())
15
+ return TaskSchema ( many = True ) .dump (tasks .tasks ())
17
16
18
17
19
18
class TaskView (View ):
@@ -23,11 +22,7 @@ class TaskView(View):
23
22
GET will safely return the current task progress.
24
23
DELETE will terminate the background task, if running.
25
24
"""
26
-
27
25
tags = ["tasks" ]
28
- schema = TaskSchema ()
29
-
30
- marshal_methods = ("GET" , "DELETE" )
31
26
32
27
def get (self , task_id ):
33
28
"""
@@ -42,7 +37,7 @@ def get(self, task_id):
42
37
43
38
task = task_dict .get (task_id )
44
39
45
- return self . schema .dump (task )
40
+ return TaskSchema () .dump (task )
46
41
47
42
def delete (self , task_id ):
48
43
"""
@@ -59,4 +54,4 @@ def delete(self, task_id):
59
54
60
55
task .kill (block = True , timeout = 3 )
61
56
62
- return self . schema .dump (task )
57
+ return TaskSchema () .dump (task )
You can’t perform that action at this time.
0 commit comments