fix: Prompt-Deaktivierung jetzt voll funktionsfähig
PROBLEME behoben: 1. Falscher Datentyp: Frontend sendete 0/1 statt boolean 2. Button-Text: "Aktiv." → "Aktivieren" 3. Keine visuelle Markierung für deaktivierte Prompts FIXES: Backend (main.py): - active-Wert wird explizit zu boolean konvertiert - Akzeptiert jetzt sowohl true/false als auch 1/0 Frontend (Analysis.jsx): - Sendet jetzt !p.active (boolean) statt p.active?0:1 - Button-Text: "Deaktivieren" / "Aktivieren" (klar lesbar) - Visuelle Markierung für inaktive Prompts: * Opacity 0.6 (ausgegraut) * Rotes Badge "⏸ Deaktiviert" - Gilt für Einzel- UND Pipeline-Prompts RESULTAT: ✅ Deaktivierte Prompts werden nicht mehr auf "Analysen starten" gezeigt ✅ Klare visuelle Unterscheidung im Prompts-Tab ✅ Button-Text eindeutig ("Aktivieren" vs "Deaktivieren") Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4886f00826
commit
3f4ef75463
2 files changed
+10
-7
No files matched your search
+2
-1
@@ -1099,7 +1099,8 @@ def update_prompt(prompt_id: str, data: dict, session: dict=Depends(require_admi
|
||||
values.append(data['template'])
|
||||
if 'active' in data:
|
||||
updates.append('active=%s')
|
||||
values.append(data['active'])
|
||||
# Convert to boolean (accepts true/false, 1/0)
|
||||
values.append(bool(data['active']))
|
||||
|
||||
if updates:
|
||||
cur.execute(f"UPDATE ai_prompts SET {', '.join(updates)}, updated=CURRENT_TIMESTAMP WHERE id=%s",
|
||||
|
||||
Reference in new issue
Block a user