Skip to content

Commit b4d4972

Browse files
author
Joel Collins
committed
Moved deprecation warning to be less annoying
1 parent d0ded32 commit b4d4972

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/labthings/default_views/tasks.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
class TaskList(View):
1111
"""List of all background actions from the session"""
1212

13+
logging.warning(
14+
"TaskList is deprecated and will be removed in a future version. Use the Actions list instead."
15+
)
16+
1317
def get(self):
14-
""" """
15-
logging.warning(
16-
"TaskList is deprecated and will be removed in a future version. Use the Actions list instead."
17-
)
1818
return TaskSchema(many=True).dump(current_labthing().actions.threads)
1919

2020

@@ -23,10 +23,12 @@ class TaskView(View):
2323
2424
GET will safely return the current task progress.
2525
DELETE will terminate the background task, if running.
26-
27-
2826
"""
2927

28+
logging.warning(
29+
"TaskList is deprecated and will be removed in a future version. Use the Actions list instead."
30+
)
31+
3032
def get(self, task_id):
3133
"""Show status of a session task
3234
@@ -35,9 +37,6 @@ def get(self, task_id):
3537
:param task_id:
3638
3739
"""
38-
logging.warning(
39-
"TaskView is deprecated and will be removed in a future version. Use the Action view instead."
40-
)
4140
task_dict = current_labthing().actions.to_dict()
4241

4342
if task_id not in task_dict:
@@ -55,9 +54,7 @@ def delete(self, task_id):
5554
:param task_id:
5655
5756
"""
58-
logging.warning(
59-
"TaskView is deprecated and will be removed in a future version. Use the Action view instead."
60-
)
57+
6158
task_dict = current_labthing().actions.to_dict()
6259

6360
if task_id not in task_dict:

0 commit comments

Comments
 (0)