Skip to content

Commit

Permalink
Labotel: Ignore divisions from deleted rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
ThiefMaster committed Jan 21, 2025
1 parent 943897e commit 09e857f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion labotel/indico_labotel/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def _process(self):

class RHDivisions(RHRoomBookingBase):
def _process(self):
return jsonify(sorted(div for div, in db.session.query(Room.division.distinct()) if div))
query = (db.session
.query(Room.division.distinct())
.filter(~Room.is_deleted, Room.division != '')) # noqa: PLC1901
return jsonify(sorted(div for div, in query))


class RHLabotelStats(RHProtected):
Expand Down

0 comments on commit 09e857f

Please sign in to comment.