Skip to content

Commit 685ac5f

Browse files
arthansonjeremystretch
authored andcommitted
13891 fix primary ip assignment if assigning ip
1 parent 0ce2b1b commit 685ac5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/ipam/forms/model_forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def clean(self):
354354
})
355355
elif selected_objects:
356356
assigned_object = self.cleaned_data[selected_objects[0]]
357-
if self.instance.pk and self.cleaned_data['primary_for_parent'] and assigned_object != self.instance.assigned_object:
357+
if self.instance.pk and self.instance.assigned_object and self.cleaned_data['primary_for_parent'] and assigned_object != self.instance.assigned_object:
358358
raise ValidationError(
359359
_("Cannot reassign IP address while it is designated as the primary IP for the parent object")
360360
)

0 commit comments

Comments
 (0)