Fix Run Checks query overwrite breaking filters and sort

This commit is contained in:
Ivo Oskamp 2026-02-27 10:19:46 +01:00
parent 2e6ff18878
commit 98567f8d05

View File

@ -1062,7 +1062,7 @@ def run_checks_page():
agg = agg.subquery() agg = agg.subquery()
q = ( rows_query = (
base.join(agg, agg.c.job_id == Job.id) base.join(agg, agg.c.job_id == Job.id)
.outerjoin(last_reviewed, last_reviewed.c.job_id == Job.id) .outerjoin(last_reviewed, last_reviewed.c.job_id == Job.id)
.add_columns( .add_columns(
@ -1071,7 +1071,7 @@ def run_checks_page():
) )
) )
# Sort for operational review: Customer > Backup > Type > Job # Sort for operational review: Customer > Backup > Type > Job
q = q.order_by( rows_query = rows_query.order_by(
Customer.name.asc().nullslast(), Customer.name.asc().nullslast(),
Job.backup_software.asc().nullslast(), Job.backup_software.asc().nullslast(),
Job.backup_type.asc().nullslast(), Job.backup_type.asc().nullslast(),
@ -1079,7 +1079,7 @@ def run_checks_page():
Job.id.asc(), Job.id.asc(),
) )
rows = [r for r in q.limit(2000).all() if not _is_hidden_3cx_non_backup(r.backup_software, r.backup_type)] rows = [r for r in rows_query.limit(2000).all() if not _is_hidden_3cx_non_backup(r.backup_software, r.backup_type)]
# Ensure override flags are up-to-date for the runs shown in this overview. # Ensure override flags are up-to-date for the runs shown in this overview.
# The Run Checks modal computes override status on-the-fly, but the overview # The Run Checks modal computes override status on-the-fly, but the overview