This commit is contained in:
Team3
2026-06-06 22:16:32 +02:00
parent 08e67cb4f1
commit 80b964fef4
5 changed files with 99 additions and 26 deletions

View File

@@ -122,6 +122,10 @@ async def remove_bausteine(topic: str):
async def create(req: GuideCreateRequest):
if req.format != "OnePager" and not bausteine_path(req.topic.strip()).exists():
raise HTTPException(400, "Erst Bausteine erstellen")
# Kein Duplikat-Start: pro Thema+Format höchstens eine laufende Generierung
for g in await list_guides():
if g["topic"] == req.topic.strip() and g["format"] == req.format and g["status"] in ("queued", "generating"):
raise HTTPException(409, "Generierung läuft bereits")
await create_topic(req.topic.strip())
now = datetime.now(timezone.utc).isoformat()
guide = {