Skip to content

Commit

Permalink
added backend forking
Browse files Browse the repository at this point in the history
  • Loading branch information
khoroshevskyi committed Jan 2, 2024
1 parent ccadbdb commit 28758c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pephub/routers/api/v1/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ async def zip_pep_for_download(proj: peppy.Project = Depends(get_project)):
)
async def fork_pep_to_namespace(
fork_request: ForkRequest,
proj: peppy.Project = Depends(get_project),
proj_annotation: AnnotationModel = Depends(get_project_annotation),
agent: PEPDatabaseAgent = Depends(get_db),
):
Expand All @@ -556,14 +555,15 @@ async def fork_pep_to_namespace(
fork_name = fork_request.fork_name
fork_tag = fork_request.fork_tag
try:
agent.project.create(
project=proj,
namespace=fork_to,
name=fork_name,
tag=fork_tag or DEFAULT_TAG,
description=proj_annotation.description,
pep_schema=proj_annotation.pep_schema,
agent.project.fork(
original_namespace=proj_annotation.namespace,
original_name=proj_annotation.name,
original_tag=proj_annotation.tag,
fork_namespace=fork_to,
fork_name=fork_name,
fork_tag=fork_tag,
)

except ProjectUniqueNameError as _:
raise HTTPException(
status_code=400,
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python-multipart>=0.0.5
tqdm
uvicorn
python-dotenv
pepdbagent @ git+https://github.com/pepkit/pepdbagent@dev#egg=pepdbagent
pepdbagent @ git+https://github.com/pepkit/pepdbagent@fork#egg=pepdbagent
peppy>=0.40.0a5
qdrant-client
requests
Expand Down

0 comments on commit 28758c5

Please sign in to comment.