-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent duplicate Resources from being created #303
Comments
Per #2036, name and event (?) should also be unique_together |
Yeah, event and timeslot ID are the same thing. |
For future reference: https://docs.djangoproject.com/en/1.11/ref/models/options/#unique-together |
Making these fields "unique_together" would break the current implementation of floating resources, which allows for duplicates (#2840): ESP-Website/esp/esp/resources/models.py Lines 220 to 222 in 76a45d2
|
It is not currently possible to create two classrooms with the same name with the normal classroom UI. When trying to add a new classroom with the same name, the code below uses the existing classroom and updates it instead: ESP-Website/esp/esp/program/modules/forms/resources.py Lines 202 to 215 in c292a39
|
Stanford ESP had a problem with Ajax scheduling that turned out to be caused by multiple Resource objects existing for a given (room name, timeslot ID) combination. This should be prevented, and also probably enforced by a unique_together constraint.
The text was updated successfully, but these errors were encountered: