learning-unlimited/ESP-Website — pull request #200 by pteromys (2011-12-12 08:27:27+00:00)
Title: Scheduling: don't short-schedule classes. (#117)

aseering correctly guessed one way to reproduce this bug (and the only way I know of so far). The commit description is included below.

-----

Apparently ClassSection.assign_room left its partial results in place if
it failed to schedule some rooms. This old behavior can be requested
with the new "allow_partial" keyword argument to assign_room; but now
the default is to undo partial results if the assignment fails.

This particular method of undoing already-assigned rooms assumes that
the until the first failure, we managed to get exclusive access to each
(room, time) for this ClassSection. In the future we may wish for
something more atomic.