mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-06 22:21:29 +02:00
Reprint from Archive kept showing `created_by_id = NULL` even after the Direct Print / File Manager / Library attribution fixes in 0.2.4b1. Root cause: reprint reuses the source archive row (via register_expected_print → _expected_prints lookup) to avoid duplicate archives. When the source was auto-created from a printer-initiated print, its created_by_id was NULL — and reprint never touched it. Print Log correctly attributed the reprinter (set_current_print_user → _print_user_info at print-complete), but the Statistics per-user filter reads archive.created_by_id and stayed unassigned forever. Fix in main.py's print-complete handler: when the archive's created_by_id is NULL and a print-session user is known, back-fill from _print_user_info. Never overwrites existing attribution — the original uploader keeps ownership; only NULLs are filled. Already-completed archives stay NULL (no retroactive rewrite). Next print after deploy credits the current user on any NULL archive.