Skip to content

Commit

Permalink
Fixes netbox-community#1238: Fix error when editing an IP with a NAT …
Browse files Browse the repository at this point in the history
…assignment which has no assigned device
  • Loading branch information
jeremystretch committed Jun 13, 2017
1 parent 8281fbb commit da30400
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 da30400

Please sign in to comment.