Skip to content

Commit

Permalink
Fixes netbox-community#1319: Fixed server error when attempting to cr…
Browse files Browse the repository at this point in the history
…eate console/power connections
  • Loading branch information
jeremystretch committed Jul 6, 2017
1 parent 9019efe commit 342c86e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/utilities/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def __init__(self, *args, **kwargs):

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)
Expand Down

0 comments on commit 342c86e

Please sign in to comment.