Skip to content

Commit

Permalink
Fixes #14363: Fix bulk editing of interfaces assigned to VM with no c…
Browse files Browse the repository at this point in the history
…luster
  • Loading branch information
jeremystretch committed Nov 29, 2023
1 parent 01ba4ce commit 792b353
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions netbox/virtualization/forms/bulk_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,10 @@ def __init__(self, *args, **kwargs):
# Check interface sites. First interface should set site, further interfaces will either continue the
# loop or reset back to no site and break the loop.
for interface in interfaces:
vm_site = interface.virtual_machine.site or interface.virtual_machine.cluster.site
if site is None:
site = interface.virtual_machine.cluster.site
elif interface.virtual_machine.cluster.site is not site:
site = vm_site
elif vm_site is not site:
site = None
break

Expand Down

0 comments on commit 792b353

Please sign in to comment.