mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Set a default self.to_field_name for FilterChoiceField
This commit is contained in:
parent
009fc4f301
commit
5008526db1
@ -596,7 +596,7 @@ class FilterChoiceField(forms.ModelMultipleChoiceField):
|
||||
# Modify the QuerySet of the field before we return it. Limit choices to any data already bound: Options
|
||||
# will be populated on-demand via the APISelect widget.
|
||||
if bound_field.data:
|
||||
kwargs = {'{}__in'.format(self.to_field_name): bound_field.data}
|
||||
kwargs = {'{}__in'.format(self.to_field_name or 'pk'): bound_field.data}
|
||||
self.queryset = self.queryset.filter(**kwargs)
|
||||
else:
|
||||
self.queryset = self.queryset.none()
|
||||
|
Loading…
Reference in New Issue
Block a user