YaleSTC / reservations

Manage equipment loans & reservations. Who can borrow what, for how long?
yalestc.github.io/reservations
MIT License
139 stars 58 forks source link

Recurring blackout conflict logic broken #1756

Closed orenyk closed 5 years ago

orenyk commented 6 years ago

Reported by the School of Art:

I have an issue that is keeping me from creating a new recurring Blackout that would lock Friday, Saturday and Sunday from reservations.

...

I am blocked from making this Blackout due to a massive number of previous reservations (see screenshot for the numbers of reservations being saved'). I checked, and one or two are legitimate reservations that overlap my intended Blackout date span. The rest go back years (to 2015!).

I’ve run into the issue where someone might have a reservation blocking a Blackout- is it possible to have a special permission class that will allow an “override” of these errors, and allow people such as Edgar and I to adjust usage regardless to when students are attempting to reserve?

The older dates being retained may be a bug?

reservations_blackout_bug

Let's set aside the "admins should be able to override blackout conflicts" question for the moment, at the very least we need to fix the logic checking for conflicts. Many of the past reservations were returned. We should also consider ignoring approved requests as they may already be in violation of a blackout.

ccadden commented 5 years ago

BlackoutController -> BlackoutUpdater -> Reservation.active && Reservation.overlaps_with_date_range

Seems to me that the active and the overlaps_with_date_range may be stepping on one another.