Skip to content

Commit

Permalink
excluded admin when fetching users
Browse files Browse the repository at this point in the history
  • Loading branch information
siwonKH committed Nov 2, 2023
1 parent 0337d65 commit 57e887f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bus_boarding_api/db/dao/user_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ async def get_all(self, limit: int, offset: int) -> List[UserModel]:
async def get_all_by_bus_id(self, bus_id: int) -> List[UserModel]:
stmt = (
select(UserModel)
.where(UserModel.boarding_bus_id == bus_id)
.where(and_(
UserModel.boarding_bus_id == bus_id,
UserModel.role != 'ADMINISTRATOR',
))
)
result = await self.session.execute(stmt)
return list(result.scalars().fetchall())
Expand Down

0 comments on commit 57e887f

Please sign in to comment.