| 110 | |
| 111 | |
| 112 | def get_external_id_to_task(session, task, task_template): |
| 113 | if not task_template: |
| 114 | return |
| 115 | if not task_template.interface_connection: |
| 116 | return |
| 117 | connection = task_template.interface_connection |
| 118 | if connection.integration_name == 'labelbox': |
| 119 | # Try to find the task external ID |
| 120 | external_map = ExternalMap.get( |
| 121 | session = session, |
| 122 | task_id = task.id, |
| 123 | diffgram_class_string = "task", |
| 124 | type = "labelbox", |
| 125 | ) |
| 126 | if not external_map: |
| 127 | return None |
| 128 | return external_map.external_id |
| 129 | |
| 130 | |
| 131 | def task_list_core(session, |