From c76bb23c6d67699b4af38ce89be7b6f4890206d5 Mon Sep 17 00:00:00 2001 From: Angelina Tingaeva Date: Wed, 6 Dec 2023 16:08:36 +0500 Subject: [PATCH] refactor(mapping_parent): one more try ti create parent task --- mapping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mapping.py b/mapping.py index 4b51aa1..a08307c 100644 --- a/mapping.py +++ b/mapping.py @@ -56,7 +56,7 @@ def get_parent_task_ids(task, ya_imported_task_response): parent_task_ids = {} - if task.get('parent') and 'gid' in task['parent'] and task['gid'] in ya_imported_task_response: + 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] @@ -146,14 +146,14 @@ def create_tasks_in_tracker(data): parent_task_ids = get_parent_task_ids(task, ya_imported_task_response) for gid, parent_id in parent_task_ids.items(): - assign_parent_task(gid, parent_id) + assign_parent_task(ya_imported_task_response[gid], parent_id) #и эта функция для родительской задачи написана -def assign_parent_task(gid, parent_id): +def assign_parent_task(id, parent_id): """ Назначение родительской задачи """ - base_url = f'https://api.tracker.yandex.net/v2/issues/{gid}' + base_url = f'https://api.tracker.yandex.net/v2/issues/{id}' headers = { 'Host': 'api.tracker.yandex.net', 'Authorization': 'OAuth y0_AgAEA7qkB3KjAArkXwAAAADzMlP9oR1lwMzBS2e94jHzdnII8Laxi7k',