@@ -527,19 +527,19 @@ class EntityCreateView(RedirectToNextMix
form = super(EntityCreateView, self).get_form(form_class)
# Limit the project selection if required.
project_id = self.request.GET.get("project", None)
if project_id:
form.fields["project"].queryset = Project.objects.filter(pk=project_id)
form.fields["project"].widget.attrs["readonly"] = True
form.fields["project"].empty_label = None
# Limit the location selection if required.
location_id = self.request.GET.get("location", None)
if location_id:
form.fields["location"].queryset = Location.objects.filter(pk=location_id)
form.fields["location"].widget.attrs["readonly"] = True
form.fields["location"].empty_label = None
return form
def get_initial(self):
"""
Returns initial values that should be pre-selected (if they were
@@ -654,13 +654,13 @@ class InterfaceCreateView(RedirectToNext
form = super(InterfaceCreateView, self).get_form(form_class)
# Limit the entity selection if required.
entity_id = self.request.GET.get("entity", None)
if entity_id:
form.fields["entity"].queryset = Entity.objects.filter(pk=entity_id)
form.fields["entity"].widget.attrs["readonly"] = True
form.fields["entity"].empty_label = False