Die Dateien wurden in mehreren Bereichen des Backend-Systems aktualisiert und hinzugefügt:
1. 'backend/' - 'startup_test.log', 'startup_test2.log' (neue Logdateien) - 'imprint.html', 'legal.html', 'legal_complex.html.backup' (Dateiänderungen) - 'utils/job_queue_system.py', 'utils/utilities
This commit is contained in:
Binary file not shown.
@ -1,3 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
"""
|
||||||
Hauptanwendung für das 3D-Druck-Management-System
|
Hauptanwendung für das 3D-Druck-Management-System
|
||||||
|
|
||||||
@ -76,11 +77,12 @@ class SessionManager:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
from flask import session, request
|
||||||
session_id = session.get('session_id')
|
session_id = session.get('session_id')
|
||||||
if not session_id:
|
if not session_id:
|
||||||
session_id = hashlib.md5(
|
timestamp = datetime.now().isoformat()
|
||||||
f"{request.remote_addr}_{datetime.now().isoformat()}".encode()
|
session_string = f'{request.remote_addr}_{timestamp}'
|
||||||
).hexdigest()
|
session_id = hashlib.md5(session_string.encode()).hexdigest()
|
||||||
session['session_id'] = session_id
|
session['session_id'] = session_id
|
||||||
|
|
||||||
file_path = os.path.join(
|
file_path = os.path.join(
|
||||||
@ -746,11 +748,34 @@ session_manager.init_app(app)
|
|||||||
|
|
||||||
@login_manager.user_loader
|
@login_manager.user_loader
|
||||||
def load_user(user_id):
|
def load_user(user_id):
|
||||||
"""Lädt einen Benutzer für Flask-Login"""
|
"""
|
||||||
|
Lädt einen Benutzer für Flask-Login.
|
||||||
|
|
||||||
|
KRITISCHER FIX: Alle User-Attribute vollständig laden VOR expunge(),
|
||||||
|
um Lazy-Loading-Probleme mit theme_preference und anderen Attributen zu vermeiden.
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
with get_db_session() as db_session:
|
with get_db_session() as db_session:
|
||||||
user = db_session.query(User).filter_by(id=int(user_id)).first()
|
user = db_session.query(User).filter_by(id=int(user_id)).first()
|
||||||
if user:
|
if user:
|
||||||
|
# ALLE User-Attribute explizit laden VOR expunge()
|
||||||
|
# Dies verhindert lazy-loading Fehler nach Session-Trennung
|
||||||
|
_ = user.theme_preference
|
||||||
|
_ = user.language_preference
|
||||||
|
_ = user.email_notifications
|
||||||
|
_ = user.browser_notifications
|
||||||
|
_ = user.dashboard_layout
|
||||||
|
_ = user.compact_mode
|
||||||
|
_ = user.show_completed_jobs
|
||||||
|
_ = user.auto_refresh_interval
|
||||||
|
_ = user.auto_logout_timeout
|
||||||
|
_ = user.department
|
||||||
|
_ = user.position
|
||||||
|
_ = user.phone
|
||||||
|
_ = user.bio
|
||||||
|
_ = user.settings
|
||||||
|
|
||||||
|
# Jetzt sicher expunge (alle Daten sind geladen)
|
||||||
db_session.expunge(user)
|
db_session.expunge(user)
|
||||||
return user
|
return user
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -1544,26 +1569,26 @@ def api_stats():
|
|||||||
'details': str(e)
|
'details': str(e)
|
||||||
}), 500
|
}), 500
|
||||||
|
|
||||||
# Statische Seiten
|
# Statische Seiten - Weiterleitungen zu Legal Blueprint
|
||||||
@app.route("/privacy")
|
@app.route("/privacy")
|
||||||
def privacy():
|
def privacy():
|
||||||
"""Datenschutzerklärung"""
|
"""Datenschutzerklärung - Weiterleitung zum Legal Blueprint"""
|
||||||
return render_template("privacy.html")
|
return redirect(url_for("legal.privacy"))
|
||||||
|
|
||||||
@app.route("/terms")
|
@app.route("/terms")
|
||||||
def terms():
|
def terms():
|
||||||
"""Nutzungsbedingungen"""
|
"""Nutzungsbedingungen - Weiterleitung zum Legal Blueprint"""
|
||||||
return render_template("terms.html")
|
return redirect(url_for("legal.terms"))
|
||||||
|
|
||||||
@app.route("/imprint")
|
@app.route("/imprint")
|
||||||
def imprint():
|
def imprint():
|
||||||
"""Impressum"""
|
"""Impressum - Weiterleitung zum Legal Blueprint"""
|
||||||
return render_template("imprint.html")
|
return redirect(url_for("legal.imprint"))
|
||||||
|
|
||||||
@app.route("/legal")
|
@app.route("/legal")
|
||||||
def legal():
|
def legal():
|
||||||
"""Rechtliche Hinweise - Weiterleitung zum Impressum"""
|
"""Rechtliche Hinweise - Weiterleitung zum Legal Blueprint"""
|
||||||
return redirect(url_for("imprint"))
|
return redirect(url_for("legal.legal"))
|
||||||
|
|
||||||
# ===== FEHLERBEHANDLUNG =====
|
# ===== FEHLERBEHANDLUNG =====
|
||||||
@app.errorhandler(400)
|
@app.errorhandler(400)
|
||||||
|
BIN
backend/backend/database/myp.db
Normal file
BIN
backend/backend/database/myp.db
Normal file
Binary file not shown.
BIN
backend/backups/myp_backup_20250619_232345.zip
Normal file
BIN
backend/backups/myp_backup_20250619_232345.zip
Normal file
Binary file not shown.
Binary file not shown.
BIN
backend/database/backups/system_backup_20250619_232845.zip
Normal file
BIN
backend/database/backups/system_backup_20250619_232845.zip
Normal file
Binary file not shown.
Binary file not shown.
4
backend/final_test.log
Normal file
4
backend/final_test.log
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
File "app.py", line 84
|
||||||
|
session_string = f'{request.remote_addr}_{timestamp}'
|
||||||
|
^
|
||||||
|
SyntaxError: invalid syntax
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user