Skip to content

Commit

Permalink
Fixes #311: Correct IPAddress family evaluation on import
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 15, 2016
1 parent da10b34 commit 4f95ce4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions netbox/ipam/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ def save(self, commit=True):
name=self.cleaned_data['interface_name'])
# Set as primary for device
if self.cleaned_data['is_primary']:
if self.instance.family == 4:
if self.instance.address.version == 4:
self.instance.primary_ip4_for = self.cleaned_data['device']
elif self.instance.family == 6:
elif self.instance.address.version == 6:
self.instance.primary_ip6_for = self.cleaned_data['device']

return super(IPAddressFromCSVForm, self).save(commit=commit)
Expand Down

0 comments on commit 4f95ce4

Please sign in to comment.