Phase 3: fix login issue

This commit is contained in:
2026-02-23 17:34:02 -05:00
parent bf10c843b2
commit e68202135a
3 changed files with 9 additions and 11 deletions
+2 -3
View File
@@ -73,11 +73,10 @@ def index():
).scalar()
# Recent inspections
recent_inspections_query = Inspection.query.order_by(Inspection.inspection_date.desc()).limit(5)
recent_inspections_query = Inspection.query.order_by(Inspection.inspection_date.desc())
if current_user.role == 'inspector':
recent_inspections_query = recent_inspections_query.filter(Inspection.inspector_id == current_user.id)
recent_inspections = recent_inspections_query.all()
recent_inspections = recent_inspections_query.limit(5).all()
# System statistics (admin/supervisor only)
total_facilities = Facility.query.filter_by(active=True).count() if current_user.role in ['admin', 'supervisor'] else 0