diff --git a/app/routers/audit_full.py b/app/routers/audit_full.py index ba232b8..17eed82 100644 --- a/app/routers/audit_full.py +++ b/app/routers/audit_full.py @@ -290,6 +290,7 @@ async def audit_full_patching(request: Request, db=Depends(get_db)): patch_weekly = db.execute(text( "SELECT last_patch_week as week, COUNT(*) as cnt FROM server_audit_full" " WHERE status IN ('ok','partial') AND last_patch_year = 2026 AND last_patch_week IS NOT NULL" + " AND (patch_status_2026 = 'patched' OR patch_status_2026 IS NULL)" " AND id IN (SELECT DISTINCT ON (hostname) id FROM server_audit_full WHERE status IN ('ok','partial') ORDER BY hostname, audit_date DESC)" " GROUP BY last_patch_week ORDER BY last_patch_week" )).fetchall()