From 1ce84db59c0900d24804121ca2bc39b62d1921e0 Mon Sep 17 00:00:00 2001 From: winet Date: Sun, 10 Mar 2024 00:29:44 +1000 Subject: [PATCH] fixed add task creation --- app/blueprints/api/tasks/routes.py | 6 ++++-- app/blueprints/frontend/templates/parse.j2 | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/blueprints/api/tasks/routes.py b/app/blueprints/api/tasks/routes.py index f7054f9..063c450 100644 --- a/app/blueprints/api/tasks/routes.py +++ b/app/blueprints/api/tasks/routes.py @@ -28,8 +28,10 @@ def create_task(session_id: int): types = list(filter(lambda item: item in ('parse', 'add', 'message'), info.keys())) - if len(types) > 0: - type = types[0] + if len(types) <= 0: + return "", 204 + + type = types[0] task = Task( name = info.get('task_name') or str(uuid.uuid4()), diff --git a/app/blueprints/frontend/templates/parse.j2 b/app/blueprints/frontend/templates/parse.j2 index 4aa9ced..a2df21f 100644 --- a/app/blueprints/frontend/templates/parse.j2 +++ b/app/blueprints/frontend/templates/parse.j2 @@ -38,7 +38,7 @@
-