mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-17 02:43:09 +00:00
fix: wrong import alias overwrote project_name with bool
assistant_chat.py and spec_creation.py imported is_valid_project_name (returns bool) aliased as validate_project_name. When used as `project_name = validate_project_name(project_name)`, the project name was replaced with True, causing "Project not found in registry" errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ from ..services.assistant_database import (
|
||||
get_conversations,
|
||||
)
|
||||
from ..utils.project_helpers import get_project_path as _get_project_path
|
||||
from ..utils.validation import is_valid_project_name as validate_project_name
|
||||
from ..utils.validation import validate_project_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from ..services.spec_chat_session import (
|
||||
remove_session,
|
||||
)
|
||||
from ..utils.project_helpers import get_project_path as _get_project_path
|
||||
from ..utils.validation import is_valid_project_name as validate_project_name
|
||||
from ..utils.validation import is_valid_project_name, validate_project_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -49,7 +49,7 @@ async def list_spec_sessions():
|
||||
@router.get("/sessions/{project_name}", response_model=SpecSessionStatus)
|
||||
async def get_session_status(project_name: str):
|
||||
"""Get status of a spec creation session."""
|
||||
if not validate_project_name(project_name):
|
||||
if not is_valid_project_name(project_name):
|
||||
raise HTTPException(status_code=400, detail="Invalid project name")
|
||||
|
||||
session = get_session(project_name)
|
||||
@@ -67,7 +67,7 @@ async def get_session_status(project_name: str):
|
||||
@router.delete("/sessions/{project_name}")
|
||||
async def cancel_session(project_name: str):
|
||||
"""Cancel and remove a spec creation session."""
|
||||
if not validate_project_name(project_name):
|
||||
if not is_valid_project_name(project_name):
|
||||
raise HTTPException(status_code=400, detail="Invalid project name")
|
||||
|
||||
session = get_session(project_name)
|
||||
@@ -95,7 +95,7 @@ async def get_spec_file_status(project_name: str):
|
||||
This is used for polling to detect when Claude has finished writing spec files.
|
||||
Claude writes this status file as the final step after completing all spec work.
|
||||
"""
|
||||
if not validate_project_name(project_name):
|
||||
if not is_valid_project_name(project_name):
|
||||
raise HTTPException(status_code=400, detail="Invalid project name")
|
||||
|
||||
project_dir = _get_project_path(project_name)
|
||||
|
||||
Reference in New Issue
Block a user