chore: Änderungen commited
This commit is contained in:
14
app.py
14
app.py
@@ -2403,6 +2403,17 @@ def get_root_mindmap_data():
|
||||
joinedload(Category.children)
|
||||
).all()
|
||||
|
||||
# Überprüfen, ob Kategorien vorhanden sind
|
||||
if not categories:
|
||||
print("Keine Hauptkategorien gefunden")
|
||||
return jsonify({
|
||||
'success': False,
|
||||
'error': 'Keine Hauptkategorien gefunden',
|
||||
'details': 'Bitte führen Sie das Datenbank-Initialisierungsskript aus'
|
||||
}), 404
|
||||
|
||||
print(f"Gefundene Hauptkategorien: {[cat.name for cat in categories]}")
|
||||
|
||||
# Basis-Knoten erstellen
|
||||
nodes = [{
|
||||
'id': 'root',
|
||||
@@ -2422,7 +2433,7 @@ def get_root_mindmap_data():
|
||||
'description': category.description or '',
|
||||
'color_code': category.color_code or '#9F7AEA',
|
||||
'category': category.name,
|
||||
'has_children': bool(category.children),
|
||||
'has_children': bool(category.children.count() > 0),
|
||||
'icon': category.icon or 'fa-solid fa-circle'
|
||||
})
|
||||
|
||||
@@ -2440,6 +2451,7 @@ def get_root_mindmap_data():
|
||||
})
|
||||
except Exception as e:
|
||||
print(f"Fehler beim Abrufen der Root-Mindmap: {str(e)}")
|
||||
traceback.print_exc()
|
||||
return jsonify({
|
||||
'success': False,
|
||||
'error': 'Root-Mindmap konnte nicht geladen werden',
|
||||
|
||||
Reference in New Issue
Block a user