Refactoring - Fix1
Dieser Commit ist enthalten in:
@@ -20,8 +20,9 @@ admin_bp = Blueprint('admin', __name__)
|
||||
@login_required
|
||||
def dashboard():
|
||||
try:
|
||||
with get_db_connection() as conn:
|
||||
with get_db_cursor(conn) as cur:
|
||||
conn = get_connection()
|
||||
cur = conn.cursor()
|
||||
try:
|
||||
# Hole Statistiken mit sicheren Defaults
|
||||
# Anzahl aktiver Lizenzen
|
||||
cur.execute("SELECT COUNT(*) FROM licenses WHERE is_active = true")
|
||||
@@ -123,6 +124,9 @@ def dashboard():
|
||||
hourly_sessions=hourly_sessions,
|
||||
resource_stats=resource_stats,
|
||||
username=session.get('username'))
|
||||
finally:
|
||||
cur.close()
|
||||
conn.close()
|
||||
|
||||
except Exception as e:
|
||||
current_app.logger.error(f"Dashboard error: {str(e)}")
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren