Spaces:
Building
Building
Update admin_routes.py
Browse files- admin_routes.py +4 -7
admin_routes.py
CHANGED
@@ -595,13 +595,10 @@ async def import_project(
|
|
595 |
# Check for duplicate name
|
596 |
cfg = ConfigProvider.get()
|
597 |
if any(p.name == project_data['name'] for p in cfg.projects if not p.deleted):
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
counter += 1
|
603 |
-
project_data['name'] = f"{base_name}_{counter}"
|
604 |
-
log_info(f"🔄 Project name changed to '{project_data['name']}' to avoid duplicate")
|
605 |
|
606 |
# Create project
|
607 |
new_project_data = {
|
|
|
595 |
# Check for duplicate name
|
596 |
cfg = ConfigProvider.get()
|
597 |
if any(p.name == project_data['name'] for p in cfg.projects if not p.deleted):
|
598 |
+
raise HTTPException(
|
599 |
+
status_code=409,
|
600 |
+
detail=f"Project with name '{project_data['name']}' already exists"
|
601 |
+
)
|
|
|
|
|
|
|
602 |
|
603 |
# Create project
|
604 |
new_project_data = {
|