From 1c57b4c939578dde16be040b0ad72f79e0e34450 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Fri, 28 Jun 2024 09:36:35 +0545 Subject: [PATCH 1/2] fix(enums): uncomment previous get_action_for_status_change code --- src/backend/app/models/enums.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/backend/app/models/enums.py b/src/backend/app/models/enums.py index 1904a86d54..95783d9c43 100644 --- a/src/backend/app/models/enums.py +++ b/src/backend/app/models/enums.py @@ -225,22 +225,22 @@ def is_status_change_action(task_action): def get_action_for_status_change(task_status: TaskStatus): """Update task action inferred from previous state.""" - return TaskAction.RELEASED_FOR_MAPPING - # match task_status: - # case TaskStatus.READY: - # return TaskAction.RELEASED_FOR_MAPPING - # case TaskStatus.LOCKED_FOR_MAPPING: - # return TaskAction.LOCKED_FOR_MAPPING - # case TaskStatus.MAPPED: - # return TaskAction.MARKED_MAPPED - # case TaskStatus.LOCKED_FOR_VALIDATION: - # return TaskAction.LOCKED_FOR_VALIDATION - # case TaskStatus.VALIDATED: - # return TaskAction.VALIDATED - # case TaskStatus.BAD: - # return TaskAction.MARKED_BAD - # case TaskStatus.SPLIT: - # return TaskAction.SPLIT_NEEDED + # return TaskAction.RELEASED_FOR_MAPPING + match task_status: + case TaskStatus.READY: + return TaskAction.RELEASED_FOR_MAPPING + case TaskStatus.LOCKED_FOR_MAPPING: + return TaskAction.LOCKED_FOR_MAPPING + case TaskStatus.MAPPED: + return TaskAction.MARKED_MAPPED + case TaskStatus.LOCKED_FOR_VALIDATION: + return TaskAction.LOCKED_FOR_VALIDATION + case TaskStatus.VALIDATED: + return TaskAction.VALIDATED + case TaskStatus.BAD: + return TaskAction.MARKED_BAD + case TaskStatus.SPLIT: + return TaskAction.SPLIT_NEEDED class TaskType(IntEnum, Enum): From 34e31bb0daa4dd20bf7d62d2d361027146faa9e1 Mon Sep 17 00:00:00 2001 From: NSUWAL123 Date: Tue, 2 Jul 2024 17:31:37 +0545 Subject: [PATCH 2/2] fix(enums): invalidated case add to function --- src/backend/app/models/enums.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/app/models/enums.py b/src/backend/app/models/enums.py index 95783d9c43..18bf241406 100644 --- a/src/backend/app/models/enums.py +++ b/src/backend/app/models/enums.py @@ -241,6 +241,8 @@ def get_action_for_status_change(task_status: TaskStatus): return TaskAction.MARKED_BAD case TaskStatus.SPLIT: return TaskAction.SPLIT_NEEDED + case TaskStatus.INVALIDATED: + return TaskAction.MARKED_INVALID class TaskType(IntEnum, Enum):