Feb 27 2026: update Issue view details

This commit is contained in:
2026-02-27 17:45:04 -05:00
parent 1ee621bf58
commit 0cf36a2f41
5 changed files with 72 additions and 6 deletions
+7 -1
View File
@@ -46,7 +46,13 @@ def index():
total_inspections = base.count()
completed = base.filter(Inspection.status == 'completed').count()
flagged = base.filter(Inspection.status == 'flagged').count()
# "Flagged" = open or in-progress issues logged within the date range,
# not inspections with status='flagged' (those get completed on submit).
flagged = Issue.query.filter(
Issue.reported_at >= start,
Issue.reported_at <= end,
Issue.status != 'resolved',
).count()
avg_score = db.session.query(func.avg(Inspection.overall_score)).filter(
Inspection.inspection_date >= start,
Inspection.inspection_date <= end,