Aug 27 - Updated web dashboard card, inspection ownership
This commit is contained in:
@@ -318,13 +318,7 @@ def list_inspections():
|
||||
# arm's `is_(None)` an inspector would keep seeing a follow-up that had
|
||||
# been handed to someone else, and two people would turn up to do it.
|
||||
if user.is_inspector:
|
||||
query = query.filter(db.or_(
|
||||
Inspection.follow_up_assigned_to == user.id,
|
||||
db.and_(
|
||||
Inspection.follow_up_assigned_to.is_(None),
|
||||
Inspection.inspector_id == user.id,
|
||||
),
|
||||
))
|
||||
query = query.filter(Inspection.follow_up_owned_by(user.id))
|
||||
|
||||
from_date_str = request.args.get('from_date')
|
||||
if from_date_str:
|
||||
|
||||
+6
-1
@@ -152,9 +152,14 @@ def dashboard_stats():
|
||||
if not fids:
|
||||
followup_q = followup_q.filter(False)
|
||||
else:
|
||||
# OWNERSHIP, not authorship: a follow-up handed to this inspector
|
||||
# belongs to them even though somebody else performed the original.
|
||||
# This tile sits directly above the Follow-up Requests list, which
|
||||
# filters the same way — counting authorship here made the two
|
||||
# disagree on the same screen.
|
||||
followup_q = followup_q.filter(
|
||||
Inspection.facility_id.in_(fids),
|
||||
Inspection.inspector_id == user.id,
|
||||
Inspection.follow_up_owned_by(user.id),
|
||||
)
|
||||
pending_followups = followup_q.count()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user