From a6961cb19afa762f85f2c2edba30bb958559d5a5 Mon Sep 17 00:00:00 2001 From: Angelina Tingaeva Date: Tue, 5 Dec 2023 18:34:12 +0500 Subject: [PATCH] refactor(mapping): change attr for get_parent_task_ids to task --- mapping.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mapping.py b/mapping.py index 56bb889..ada7367 100644 --- a/mapping.py +++ b/mapping.py @@ -49,18 +49,19 @@ def get_task_status(task): completed_at = '' return status, completed_at + # здесь функция для дальнейшей работы с parent -def get_parent_task_ids(data, ya_imported_task_response): +def get_parent_task_ids(task, ya_imported_task_response): """ Получение соответствий между идентификаторами подзадач в Асане и Яндекс Трекере """ parent_task_ids = {} - for task in data["data"]: - if task.get('parent') and 'gid' in task['parent']: - parent_gid = task['parent']['gid'] - if parent_gid in ya_imported_task_response: - parent_id = ya_imported_task_response[parent_gid] - parent_task_ids[task['gid']] = parent_id + # for task in data["data"]: + if task.get('parent') and 'gid' in task['parent']: + parent_gid = task['parent']['gid'] + if parent_gid in ya_imported_task_response: + parent_id = ya_imported_task_response[parent_gid] + parent_task_ids[task['gid']] = parent_id return parent_task_ids