Jul 9 - Update Inspector can't see QR codes at all

This commit is contained in:
2026-07-09 11:30:25 -04:00
parent 5689957682
commit 40ac335f5a
2 changed files with 10 additions and 7 deletions
+8 -7
View File
@@ -191,16 +191,17 @@ def facility_qr_regenerate(facility_id):
def facility_qr_print_all():
"""Printable sheet of QR codes for all facilities the user can see.
Optional ?contract_id=<id> limits the sheet to one contract. Inspectors are
scoped to their contracted facilities; customers to their assigned
facilities; managers see all active facilities.
Optional ?contract_id=<id> limits the sheet to one contract. Inspectors have
no QR management (403); customers are scoped to their assigned facilities;
managers see all active facilities.
"""
# QR management is not an inspector task.
if current_user.role == 'inspector':
abort(403)
contract_id = request.args.get('contract_id', type=int)
if current_user.role == 'inspector':
fids = get_inspector_scope(current_user) or []
query = Facility.query.filter(Facility.id.in_(fids), Facility.active == True)
elif current_user.role == 'customer':
if current_user.role == 'customer':
fids = get_customer_scope(current_user) or []
query = Facility.query.filter(Facility.id.in_(fids), Facility.active == True)
else: