feat: already_done checkbox in schedule modal; fix: capacity check skips ended slots; feat: ha_poll_interval configurable
Deploy via Portainer / deploy (push) Successful in 0s
Deploy via Portainer / deploy (push) Successful in 0s
This commit is contained in:
@@ -1799,6 +1799,14 @@ def api_new_slot():
|
||||
if over:
|
||||
conn.close()
|
||||
return jsonify({'error': f"Capacité maximale atteinte : {peak} impression(s) déjà en cours sur ce créneau (limite : {max_printers} simultanées). Décalez l'horaire ou attendez qu'une imprimante se libère."}), 409
|
||||
already_done = bool(d.get('already_done', False))
|
||||
if already_done:
|
||||
# Retroactive — skip capacity/overlap checks, insert as done
|
||||
conn.execute(
|
||||
'INSERT INTO print_slots(job_id,printer_id,planned_start,planned_end,status) VALUES(?,?,?,?,?)',
|
||||
(job_id, printer_id, start_dt.isoformat(), end_dt.isoformat(), 'done'))
|
||||
conn.commit(); conn.close()
|
||||
return jsonify({'ok': True})
|
||||
conn.execute('INSERT INTO print_slots(job_id,printer_id,planned_start,planned_end,status) VALUES(?,?,?,?,?)',
|
||||
(job_id, printer_id, start_dt.isoformat(), end_dt.isoformat(), 'planned'))
|
||||
conn.commit(); conn.close()
|
||||
|
||||
Reference in New Issue
Block a user