diff --git a/conntrackt/views.py b/conntrackt/views.py --- a/conntrackt/views.py +++ b/conntrackt/views.py @@ -530,13 +530,13 @@ class EntityCreateView(RedirectToNextMix 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 @@ -657,7 +657,7 @@ class InterfaceCreateView(RedirectToNext 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 return form