{"record":{"id":"d031ad506b534b2b","repo":"Significant-Gravitas/AutoGPT","slug":"target-organization-has-already-approved-this-tran","errorCode":null,"errorMessage":"Target organization has already approved this transfer","messagePattern":"Target organization has already approved this transfer","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/transfers/db.py","lineNumber":107,"sourceCode":"\n    if tr.status in (\"COMPLETED\", \"REJECTED\"):\n        raise ValueError(f\"Cannot approve a transfer with status '{tr.status}'\")\n\n    update_data: dict = {}\n\n    if org_id == tr.sourceOrganizationId:\n        if tr.sourceApprovedByUserId is not None:\n            raise ValueError(\"Source organization has already approved this transfer\")\n        update_data[\"sourceApprovedByUserId\"] = user_id\n        if tr.targetApprovedByUserId is not None:\n            # Both sides approved — ready for execution (NOT completed yet)\n            update_data[\"status\"] = \"TARGET_APPROVED\"\n        else:\n            update_data[\"status\"] = \"SOURCE_APPROVED\"\n\n    elif org_id == tr.targetOrganizationId:\n        if tr.targetApprovedByUserId is not None:\n            raise ValueError(\"Target organization has already approved this transfer\")\n        update_data[\"targetApprovedByUserId\"] = user_id\n        if tr.sourceApprovedByUserId is not None:\n            # Both sides approved — ready for execution (NOT completed yet)\n            update_data[\"status\"] = \"SOURCE_APPROVED\"\n        else:\n            update_data[\"status\"] = \"TARGET_APPROVED\"\n\n    else:\n        raise ValueError(\"Your active organization is not a party to this transfer\")\n\n    updated = await prisma.transferrequest.update(\n        where={\"id\": transfer_id},\n        data=update_data,\n    )\n    return TransferResponse.from_db(updated)\n\n\nasync def reject_transfer(","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/transfers/db.py#L89-L125","documentation":"Error \"Target organization has already approved this transfer\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/transfers/db.py:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; the target organization already approved.","Wait for the source organization to approve."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}