Skip to content

Commit

Permalink
validate parent id
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Nov 17, 2024
1 parent d2d9fc0 commit ddccad8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hypha/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ async def _handle_existing_artifact(
)
if parent_id != existing_artifact.parent_id:
raise FileExistsError(
f"Artifact with alias '{alias}' already exists in a different parent artifact."
f"Artifact with alias '{alias}' already exists in a different parent artifact, please remove it first."
)
if not overwrite:
raise FileExistsError(
Expand Down Expand Up @@ -905,6 +905,7 @@ async def create(
async with session.begin():
parent_artifact = None
if parent_id:
parent_id = self._validate_artifact_id(parent_id, context)
parent_artifact, _ = await self._get_artifact_with_permission(
user_info, parent_id, "create", session
)
Expand Down

0 comments on commit ddccad8

Please sign in to comment.