refactor(mapping): change attr for get_parent_task_ids to task

This commit is contained in:
Angelina Tingaeva 2023-12-05 18:34:12 +05:00
parent af2805d793
commit a6961cb19a

View File

@ -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