mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix(managed_files): match provider-format ids against model_object_id and flat_model_file_ids
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c6e95ecc76
commit
2f958f2187
2 changed files with 4 additions and 4 deletions
|
|
@ -438,7 +438,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
|
|||
return
|
||||
managed_object = (
|
||||
await self.prisma_client.db.litellm_managedobjecttable.find_first(
|
||||
where={"unified_object_id": object_id}
|
||||
where={"OR": [{"unified_object_id": object_id}, {"model_object_id": object_id}]}
|
||||
)
|
||||
)
|
||||
if managed_object is None:
|
||||
|
|
@ -466,7 +466,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
|
|||
return
|
||||
managed_file = (
|
||||
await self.prisma_client.db.litellm_managedfiletable.find_first(
|
||||
where={"unified_file_id": file_id}
|
||||
where={"OR": [{"unified_file_id": file_id}, {"flat_model_file_ids": {"has": file_id}}]}
|
||||
)
|
||||
)
|
||||
if managed_file is None:
|
||||
|
|
|
|||
|
|
@ -3227,7 +3227,7 @@ async def test_team_b_cannot_access_team_a_provider_format_batch(
|
|||
|
||||
assert exc_info.value.status_code == 403
|
||||
prisma_client.db.litellm_managedobjecttable.find_first.assert_awaited_once_with(
|
||||
where={"unified_object_id": batch_id}
|
||||
where={"OR": [{"unified_object_id": batch_id}, {"model_object_id": batch_id}]}
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -3360,7 +3360,7 @@ async def test_team_b_cannot_access_team_a_provider_format_file(
|
|||
|
||||
assert exc_info.value.status_code == 403
|
||||
prisma_client.db.litellm_managedfiletable.find_first.assert_awaited_once_with(
|
||||
where={"unified_file_id": file_id}
|
||||
where={"OR": [{"unified_file_id": file_id}, {"flat_model_file_ids": {"has": file_id}}]}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue