Skip to content

Commit

Permalink
omit users outside of time window
Browse files Browse the repository at this point in the history
  • Loading branch information
soof-golan committed Oct 28, 2024
1 parent 5b35530 commit 4ffd775
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/routes/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ async def stats(
.join(WaitingRoom, DbRegistrant.waiting_room_id == WaitingRoom.id)
.where(WaitingRoom.id == str(query.id))
.where(WaitingRoom.owner_id == str(user.id))
.where(DbRegistrant.turnstile_timestamp > WaitingRoom.opens_at)
.where(DbRegistrant.turnstile_timestamp < WaitingRoom.closes_at)
)
).scalar_one()

Expand Down Expand Up @@ -205,6 +207,8 @@ async def registrants(
.join(WaitingRoom, WaitingRoom.id == DbRegistrant.waiting_room_id)
.where(WaitingRoom.id == query.id)
.where(WaitingRoom.owner_id == user.id)
.where(DbRegistrant.turnstile_timestamp > WaitingRoom.opens_at)
.where(DbRegistrant.turnstile_timestamp < WaitingRoom.closes_at)
.order_by(DbRegistrant.turnstile_timestamp.asc().nulls_last())
)

Expand Down

0 comments on commit 4ffd775

Please sign in to comment.