svthalia / sagexit

A stripped down Django reservation system using SAML
https://reservations.thalia.nu
GNU Affero General Public License v3.0
4 stars 1 forks source link

Room occupation not computed properly during capacity check #16

Closed JobDoesburg closed 3 years ago

JobDoesburg commented 3 years ago

https://github.com/svthalia/sagexit/blob/a33e48b1cb84d10ab1dd504221fab6d0a9b1d811/website/room_reservation/views.py#L43-L53

Currently we count all overlapping reservations when adding a new reservation. However, it is very well possible that in total the amount of overlapping reservations exceeds 6 when some reservations take longer others take shorter. We should count the overlapping reservations that all overlap with each other (so 10:00-12:00 and 12:00-14:00 both overlap with 10:00-14:00, but in the capacity computation, they should count as 1).