learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
82 stars 57 forks source link

Ignore duplicate room resources when scheduling classes #3695

Closed willgearty closed 7 months ago

willgearty commented 8 months ago

While it is not currently possible to create duplicate classrooms (see https://github.com/learning-unlimited/ESP-Website/issues/303#issuecomment-1791752073), this makes it so any stray duplicate room resources (either those created before such duplicates were made impossible or those created manually in the admin panel) do not cause issues when scheduling classes with the ajax scheduler. We now ignore any of these duplicates, and the order_by() call should make it so we always ignore the same duplicate resource(s).

Fixes https://github.com/learning-unlimited/ESP-Website/issues/1188.