(self, request, pk=None)
| 190 | |
| 191 | class ShareTaskView(TaskView): |
| 192 | def get(self, request, pk=None): |
| 193 | task = self.get_and_check_task(request, pk) |
| 194 | |
| 195 | assets = [] |
| 196 | for file_name in task.available_assets: |
| 197 | if file_name not in FILE_TO_ASSET: |
| 198 | continue |
| 199 | asset_type = FILE_TO_ASSET[file_name] |
| 200 | |
| 201 | asset_info = get_asset_info(task.id, asset_type) |
| 202 | ion_id = asset_info["id"] |
| 203 | is_error = len(asset_info["error"]) > 0 |
| 204 | is_task = is_asset_task(asset_info) |
| 205 | is_exported = asset_info["id"] is not None and not is_task |
| 206 | |
| 207 | assets.append( |
| 208 | { |
| 209 | "type": asset_type, |
| 210 | "isError": is_error, |
| 211 | "isTask": is_task, |
| 212 | "isExported": is_exported, |
| 213 | **asset_info, |
| 214 | } |
| 215 | ) |
| 216 | |
| 217 | return Response({"items": assets}, status=status.HTTP_200_OK) |
| 218 | |
| 219 | def post(self, request, pk=None): |
| 220 | from app.plugins import logger |
no test coverage detected