feat: add integration tests for project and scenario lifecycles, update templates to new Starlette signature, and optimize project retrieval logic
This commit is contained in:
@@ -40,7 +40,10 @@ class ProjectRepository:
|
||||
stmt = select(Project).where(Project.id == project_id)
|
||||
if with_children:
|
||||
stmt = stmt.options(joinedload(Project.scenarios))
|
||||
project = self.session.execute(stmt).scalar_one_or_none()
|
||||
result = self.session.execute(stmt)
|
||||
if with_children:
|
||||
result = result.unique()
|
||||
project = result.scalar_one_or_none()
|
||||
if project is None:
|
||||
raise EntityNotFoundError(f"Project {project_id} not found")
|
||||
return project
|
||||
|
||||
Reference in New Issue
Block a user