From 5e971994ff7385d6707c006ef290d8517e144fed Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 12 Mar 2020 17:43:11 -0400 Subject: [PATCH] Closes #4362: Standardize URL for creation of RackReservations --- netbox/dcim/forms.py | 12 +++++++++-- netbox/dcim/tests/test_views.py | 1 - netbox/dcim/urls.py | 2 +- netbox/dcim/views.py | 12 +++++------ netbox/templates/dcim/rack.html | 6 +++--- .../templates/dcim/rackreservation_edit.html | 21 +++++++++++++++++++ 6 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 netbox/templates/dcim/rackreservation_edit.html diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index ac8fc40d5..f2719eca6 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -791,6 +791,13 @@ class RackElevationFilterForm(RackFilterForm): # class RackReservationForm(BootstrapMixin, TenancyForm, forms.ModelForm): + rack = forms.ModelChoiceField( + queryset=Rack.objects.all(), + required=False, + widget=forms.HiddenInput() + ) + # TODO: Change this to an API-backed form field. We can't do this currently because we want to retain + # the multi-line