From ab97f5df3c5be0292ce73ea2b197036cd6548d15 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 18 Dec 2020 16:03:57 +0100 Subject: [PATCH] minor fixes --- .../modules/ftrack/events/event_task_to_parent_status.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pype/modules/ftrack/events/event_task_to_parent_status.py b/pype/modules/ftrack/events/event_task_to_parent_status.py index a0b7c12408..159c8ffd1c 100644 --- a/pype/modules/ftrack/events/event_task_to_parent_status.py +++ b/pype/modules/ftrack/events/event_task_to_parent_status.py @@ -164,6 +164,9 @@ class TaskStatusToParent(BaseEvent): valid_parent_ids.add(entity["id"]) status_ids.add(entity["status_id"]) + if not valid_parent_ids: + return + task_entities = session.query( ( "select id, parent_id, status_id from TypedContext" @@ -326,14 +329,14 @@ class TaskStatusToParent(BaseEvent): ] all_match = {} for new_status_name, task_status_names in _all_match.items(): - all_match[new_status_name.lower] = [ + all_match[new_status_name.lower()] = [ status_name.lower() for status_name in task_status_names ] single_match = {} for new_status_name, task_status_names in _single_match.items(): - single_match[new_status_name.lower] = [ + single_match[new_status_name.lower()] = [ status_name.lower() for status_name in task_status_names ] @@ -356,7 +359,7 @@ class TaskStatusToParent(BaseEvent): task_statuses_lowered.add(low_status_name) new_status = None - for _new_status, task_statuses in all_match: + for _new_status, task_statuses in all_match.items(): valid_item = True for status_name_low in task_statuses_lowered: if status_name_low not in task_statuses: