refactor(mapping): change attr for get_parent_task_ids to task
This commit is contained in:
		
							
								
								
									
										15
									
								
								mapping.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user