Fix incorrect and failing reservation rule lists #756
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
APIReservationRuleListView
inherited by mistake fromMachineRelatedViewMixin
instead ofMachineTypeRelatedViewMixin
, and the rest of the code was working with the assumption that the URL path's<int:pk>
segment should be the PK of a machine type, like:web/src/make_queue/static/make_queue/js/calendar.js
Line 393 in a4de522
So sometimes, the machine type PK in the URL happened to equal the PK of an existing machine, and other times, it did not. This fixes that :)
(Fun fact: This fix was actually applied locally on the server a couple years ago, and has been running there ever since 😅)
Areas to review closely
None in particular.
Checklist
(If any of the points are not relevant, mark them as checked)
dev
and notmain
makemigrations
,makemessages
andcompilemessages
management commands and committed any changes that should be included in this PR