Skip to content

Commit

Permalink
Fixes #1238: Fix error when editing an IP with a NAT assignment which…
Browse files Browse the repository at this point in the history
… has no assigned device
  • Loading branch information
jeremystretch committed Jun 13, 2017
1 parent 8eb9c45 commit 252ab0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/ipam/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def __init__(self, *args, **kwargs):
initial['interface_site'] = instance.interface.device.site
initial['interface_rack'] = instance.interface.device.rack
initial['interface_device'] = instance.interface.device
if instance and instance.nat_inside is not None:
if instance and instance.nat_inside and instance.nat_inside.device is not None:
initial['nat_site'] = instance.nat_inside.device.site
initial['nat_rack'] = instance.nat_inside.device.rack
initial['nat_device'] = instance.nat_inside.device
Expand Down

0 comments on commit 252ab0f

Please sign in to comment.