diff --git a/epictrack-api/src/api/models/staff.py b/epictrack-api/src/api/models/staff.py index 3d353058e..41840192b 100644 --- a/epictrack-api/src/api/models/staff.py +++ b/epictrack-api/src/api/models/staff.py @@ -15,7 +15,7 @@ from typing import List -from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, func, DateTime +from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, asc, func, DateTime from sqlalchemy.orm import column_property, relationship from api.models.base_model import BaseModelVersioned @@ -69,7 +69,7 @@ def find_active_staff_by_positions(cls, position_ids: List[int]): """Return active staffs by position ids.""" return cls.query.filter( Staff.position_id.in_(position_ids), Staff.is_active.is_(True) - ) + ).order_by(asc(Staff.first_name), asc(Staff.last_name)) @classmethod def find_all_active_staff(cls):