Skip to content

Commit

Permalink
Fixes: #15502 - Correct exception on IP import form when VM is target
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps authored and jeremystretch committed Apr 3, 2024
1 parent bbd7ddb commit 7d54357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/ipam/forms/bulk_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def save(self, *args, **kwargs):

# Set as primary for device/VM
if self.cleaned_data.get('is_primary'):
parent = self.cleaned_data['device'] or self.cleaned_data['virtual_machine']
parent = self.cleaned_data.get('device') or self.cleaned_data.get('virtual_machine')
if self.instance.address.version == 4:
parent.primary_ip4 = ipaddress
elif self.instance.address.version == 6:
Expand Down

0 comments on commit 7d54357

Please sign in to comment.