Skip to content

Commit

Permalink
Fixes #1319: Fixed server error when attempting to create console/pow…
Browse files Browse the repository at this point in the history
…er connections
  • Loading branch information
jeremystretch committed Jul 6, 2017
1 parent 0fc9ed8 commit b253c8c
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 b253c8c

Please sign in to comment.