feat: add swap functionality for unit and modem assignments in vibration monitoring locations
This commit is contained in:
@@ -355,8 +355,11 @@ async def nrl_detail_page(
|
||||
).first()
|
||||
|
||||
assigned_unit = None
|
||||
assigned_modem = None
|
||||
if assignment:
|
||||
assigned_unit = db.query(RosterUnit).filter_by(id=assignment.unit_id).first()
|
||||
if assigned_unit and assigned_unit.deployed_with_modem_id:
|
||||
assigned_modem = db.query(RosterUnit).filter_by(id=assigned_unit.deployed_with_modem_id).first()
|
||||
|
||||
# Get session count
|
||||
session_count = db.query(MonitoringSession).filter_by(location_id=location_id).count()
|
||||
@@ -393,6 +396,7 @@ async def nrl_detail_page(
|
||||
"location": location,
|
||||
"assignment": assignment,
|
||||
"assigned_unit": assigned_unit,
|
||||
"assigned_modem": assigned_modem,
|
||||
"session_count": session_count,
|
||||
"file_count": file_count,
|
||||
"active_session": active_session,
|
||||
|
||||
Reference in New Issue
Block a user