no-mistakes(review): Fix F01/F02/F05: technician name, duplicate timeline, FM dashboard property counts
This commit is contained in:
@@ -196,7 +196,7 @@ async def list_tickets(
|
||||
|
||||
# Paginate
|
||||
offset = (page - 1) * page_size
|
||||
query = query.order_by(Ticket.created_at.desc()).offset(offset).limit(page_size)
|
||||
query = query.order_by(Ticket.created_at.desc()).offset(offset).limit(page_size).options(selectinload(Ticket.assigned_technician))
|
||||
|
||||
result = await db.execute(query)
|
||||
tickets = list(result.scalars().all())
|
||||
@@ -214,8 +214,8 @@ async def update_ticket(
|
||||
|
||||
# Handle status transitions separately
|
||||
new_status = data.get("status")
|
||||
old_status = ticket.status
|
||||
if new_status is not None:
|
||||
old_status = ticket.status
|
||||
if old_status != new_status:
|
||||
valid_targets = VALID_TRANSITIONS.get(old_status, [])
|
||||
if new_status not in valid_targets:
|
||||
@@ -277,7 +277,7 @@ async def update_ticket(
|
||||
|
||||
# Handle standalone note (no status change)
|
||||
note_only = data.get("note")
|
||||
if note_only and (new_status is None or new_status == ticket.status):
|
||||
if note_only and not (new_status is not None and old_status != new_status):
|
||||
await _log_status_change(
|
||||
db,
|
||||
ticket.id,
|
||||
|
||||
Reference in New Issue
Block a user