05/19 Add iOS app support page
This commit is contained in:
+13
-2
@@ -110,9 +110,14 @@ def index():
|
||||
recent_inspections = recent_q.limit(5).all()
|
||||
|
||||
# ── Pending follow-up inspections ────────────────────────────────────
|
||||
# follow_ups is a lazy='dynamic' relationship — comparing it to None does
|
||||
# NOT produce a "has no rows" predicate for dynamic relationships. The
|
||||
# correct idiom is ~.any(), which generates EXISTS (SELECT 1 FROM inspections
|
||||
# WHERE parent_inspection_id = inspections.id). This matches the identical
|
||||
# filter used in routes/inspections.py:follow_up_filter.
|
||||
followup_q = Inspection.query.filter_by(
|
||||
follow_up_required=True, status='completed'
|
||||
).filter(Inspection.follow_ups == None) # noqa: E711 — SQLAlchemy usage
|
||||
).filter(~Inspection.follow_ups.any())
|
||||
if is_inspector:
|
||||
followup_q = followup_q.filter(Inspection.inspector_id == current_user.id)
|
||||
elif is_customer:
|
||||
@@ -286,4 +291,10 @@ def facility_trend():
|
||||
'labels': [str(r.day) for r in rows],
|
||||
'data': [round(float(r.avg), 2) for r in rows],
|
||||
'facility': facility.name,
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@bp.route('/support')
|
||||
def support():
|
||||
"""Public support page — no login required. Used as App Store Connect Support URL."""
|
||||
return render_template('support.html', current_year=datetime.utcnow().year)
|
||||
Reference in New Issue
Block a user