Skip to content

Commit

Permalink
Merge pull request #1686 from crablab/fix/actually-limit-lts
Browse files Browse the repository at this point in the history
Actually limit the number of LTs
  • Loading branch information
lukegb committed May 28, 2024
2 parents 27689d8 + c528c93 commit 7945e64
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/cfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,12 @@ def get_remaining_lightning_slots(cls):
day: count
for (day, count) in cls.query.with_entities(
cls.session,
func.count(cls.id),
# This is a horrible hack but we need to limit the LT slots for now
# and they have been preseeded as 12 in the DB (which is more than we can fit)
func.least(func.count(cls.id), 6)
)
.filter(cls.state != "withdrawn")
.group_by(cls.session)
# This is a horrible hack but we need to limit the LT slots for now
# and they have been preseeded as 12 in the DB (which is more than we can fit)
.limit(6)
.all()
}
return {day: (count - day_counts.get(day, 0)) for (day, count) in slots.items()}
Expand Down

0 comments on commit 7945e64

Please sign in to comment.