Jul 10 - Update codes to catch up with the single tenant project
This commit is contained in:
+36
-9
@@ -235,15 +235,17 @@ def index():
|
||||
)
|
||||
)
|
||||
|
||||
issue_id_filter = request.args.get('issue_id', '').strip()
|
||||
severity_filter = request.args.get('severity', '')
|
||||
status_filter = request.args.get('status', '')
|
||||
sla_filter = request.args.get('sla', '')
|
||||
facility_filter = request.args.get('facility_id', '')
|
||||
contract_filter = request.args.get('contract_id', '')
|
||||
date_from_filter = request.args.get('date_from', '')
|
||||
date_to_filter = request.args.get('date_to', '')
|
||||
reporter_filter = request.args.get('reporter_id', '')
|
||||
issue_id_filter = request.args.get('issue_id', '').strip()
|
||||
severity_filter = request.args.get('severity', '')
|
||||
status_filter = request.args.get('status', '')
|
||||
sla_filter = request.args.get('sla', '')
|
||||
facility_filter = request.args.get('facility_id', '')
|
||||
contract_filter = request.args.get('contract_id', '')
|
||||
date_from_filter = request.args.get('date_from', '')
|
||||
date_to_filter = request.args.get('date_to', '')
|
||||
reporter_filter = request.args.get('reporter_id', '')
|
||||
handler_type_filter = request.args.get('handler_type', '')
|
||||
unassigned_filter = request.args.get('unassigned', '')
|
||||
|
||||
if issue_id_filter.isdigit():
|
||||
q = q.filter(Issue.id == int(issue_id_filter))
|
||||
@@ -280,6 +282,17 @@ def index():
|
||||
Area.facility_id == fid,
|
||||
)
|
||||
)
|
||||
if handler_type_filter:
|
||||
if handler_type_filter == 'internal':
|
||||
# NULL handler_type means 'internal' (the default)
|
||||
q = q.filter(db.or_(
|
||||
Issue.handler_type == 'internal',
|
||||
Issue.handler_type.is_(None),
|
||||
))
|
||||
else:
|
||||
q = q.filter(Issue.handler_type == handler_type_filter)
|
||||
if unassigned_filter:
|
||||
q = q.filter(Issue.assigned_to.is_(None))
|
||||
# SLA filter — SLA status is computed in Python (not a DB column).
|
||||
# When active: load all matching rows, filter in Python, wrap in a
|
||||
# single-page compatible object so the template interface is unchanged.
|
||||
@@ -353,6 +366,8 @@ def index():
|
||||
date_from_filter=date_from_filter,
|
||||
date_to_filter=date_to_filter,
|
||||
reporter_filter=reporter_filter,
|
||||
handler_type_filter=handler_type_filter,
|
||||
unassigned_filter=unassigned_filter,
|
||||
facilities=facilities,
|
||||
projects=projects,
|
||||
staff=staff,
|
||||
@@ -439,6 +454,18 @@ def view(issue_id):
|
||||
issue.vendor_contact = form.vendor_contact.data.strip() or None
|
||||
issue.vendor_notes = form.vendor_notes.data.strip() or None
|
||||
|
||||
# Handler type (phase39)
|
||||
ht = form.handler_type.data or None
|
||||
issue.handler_type = ht
|
||||
if ht == 'facility':
|
||||
issue.facility_handler_name = form.facility_handler_name.data.strip() or None
|
||||
issue.facility_handler_contact = form.facility_handler_contact.data.strip() or None
|
||||
issue.facility_handler_notes = form.facility_handler_notes.data.strip() or None
|
||||
else:
|
||||
issue.facility_handler_name = None
|
||||
issue.facility_handler_contact = None
|
||||
issue.facility_handler_notes = None
|
||||
|
||||
from app.routes.inspections import _save_photo
|
||||
new_photos = []
|
||||
for file_obj in request.files.getlist('result_photos'):
|
||||
|
||||
Reference in New Issue
Block a user