update project with project_revision_id (#3083)
This commit is contained in:
@@ -3537,7 +3537,7 @@ class AgentDB:
|
|||||||
|
|
||||||
async def update_project(
|
async def update_project(
|
||||||
self,
|
self,
|
||||||
project_id: str,
|
project_revision_id: str,
|
||||||
organization_id: str,
|
organization_id: str,
|
||||||
artifact_id: str | None = None,
|
artifact_id: str | None = None,
|
||||||
workflow_permanent_id: str | None = None,
|
workflow_permanent_id: str | None = None,
|
||||||
@@ -3548,9 +3548,8 @@ class AgentDB:
|
|||||||
async with self.Session() as session:
|
async with self.Session() as session:
|
||||||
get_project_query = (
|
get_project_query = (
|
||||||
select(ProjectModel)
|
select(ProjectModel)
|
||||||
.filter_by(project_id=project_id)
|
|
||||||
.filter_by(organization_id=organization_id)
|
.filter_by(organization_id=organization_id)
|
||||||
.filter(ProjectModel.deleted_at.is_(None))
|
.filter_by(project_revision_id=project_revision_id)
|
||||||
)
|
)
|
||||||
if project := (await session.scalars(get_project_query)).first():
|
if project := (await session.scalars(get_project_query)).first():
|
||||||
if artifact_id:
|
if artifact_id:
|
||||||
@@ -3570,7 +3569,7 @@ class AgentDB:
|
|||||||
LOG.error("SQLAlchemyError", exc_info=True)
|
LOG.error("SQLAlchemyError", exc_info=True)
|
||||||
raise
|
raise
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
LOG.error("No project found to update", project_id=project_id)
|
LOG.error("No project found to update", project_revision_id=project_revision_id)
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.error("UnexpectedError", exc_info=True)
|
LOG.error("UnexpectedError", exc_info=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user