fixed netbox.js issue, with display field; fixed api select bootstrap

This commit is contained in:
Hedde van der Heide
2021-11-27 13:24:14 +01:00
parent 65db3f0a39
commit 76b0dd2c5d
3 changed files with 19 additions and 18 deletions
+1
View File
@@ -21,6 +21,7 @@ class CustomDynamicModelMultipleChoiceField(DynamicModelMultipleChoiceField):
# 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.
data = bound_field.value()
if data:
field_name = getattr(self, "to_field_name") or "pk"
filter = self.filter(field_name=field_name)