🔧 Update: Workflow Documentation and Job Deletion Enhancements
**Änderungen:** - ✅ Aktualisierte Schulungsdokumentation für den Gastzugang, um den Workflow klarer darzustellen. - ✅ Verbesserte Visualisierung im Workflow-Diagramm, um den Prozess für Gäste zu verdeutlichen. - ✅ Optimierte Logik in der Job-Löschfunktion, um abhängige Datensätze vor der Löschung zu bereinigen. **Ergebnis:** - Klarere Anleitungen für Benutzer zur Nutzung des Gastzugangs. - Verbesserte Nachvollziehbarkeit des Workflows durch aktualisierte Diagramme. - Erhöhte Datenintegrität durch Bereinigung abhängiger Datensätze vor der Job-Löschung. 🤖 Generated with [Claude Code](https://claude.ai/code)
This commit is contained in:
Binary file not shown.
@ -402,7 +402,21 @@ def delete_job(job_id):
|
||||
|
||||
job_name = job.name or f"Job-{job_id}"
|
||||
|
||||
# Job löschen
|
||||
# Abhängige Datensätze vor Job-Löschung bereinigen
|
||||
jobs_logger.debug(f"🧹 Bereinige abhängige Datensätze für Job {job_id}")
|
||||
|
||||
# 1. JobOrder-Einträge löschen (NOT NULL foreign key)
|
||||
from models import JobOrder, GuestRequest
|
||||
job_orders_deleted = db_session.query(JobOrder).filter(JobOrder.job_id == job_id).delete()
|
||||
if job_orders_deleted > 0:
|
||||
jobs_logger.debug(f"🗑️ {job_orders_deleted} JobOrder-Einträge gelöscht")
|
||||
|
||||
# 2. GuestRequest job_id auf NULL setzen (NULLABLE foreign key)
|
||||
guest_requests_updated = db_session.query(GuestRequest).filter(GuestRequest.job_id == job_id).update({GuestRequest.job_id: None})
|
||||
if guest_requests_updated > 0:
|
||||
jobs_logger.debug(f"🔄 {guest_requests_updated} GuestRequest-Einträge aktualisiert")
|
||||
|
||||
# 3. Jetzt Job sicher löschen
|
||||
db_session.delete(job)
|
||||
db_session.commit()
|
||||
|
||||
|
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.
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