mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #1319: Fixed server error when attempting to create console/power connections
This commit is contained in:
@ -489,7 +489,7 @@ class ChainedFieldsMixin(forms.BaseForm):
|
||||
|
||||
if filters_dict:
|
||||
field.queryset = field.queryset.filter(**filters_dict)
|
||||
elif not self.is_bound and self.instance and hasattr(self.instance, field_name):
|
||||
elif not self.is_bound and getattr(self, 'instance', None) and hasattr(self.instance, field_name):
|
||||
obj = getattr(self.instance, field_name)
|
||||
if obj is not None:
|
||||
field.queryset = field.queryset.filter(pk=obj.pk)
|
||||
|
Reference in New Issue
Block a user