mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
Syntax tweak
This commit is contained in:
parent
9003e1f70b
commit
a726083484
@ -1098,10 +1098,7 @@ class Device(
|
||||
|
||||
:param if_master: If True, return VC member interfaces only if this Device is the VC master.
|
||||
"""
|
||||
if self.pk:
|
||||
filter = Q(device=self)
|
||||
else:
|
||||
filter = Q()
|
||||
filter = Q(device=self) if self.pk else Q()
|
||||
if self.virtual_chassis and (self.virtual_chassis.master == self or not if_master):
|
||||
filter |= Q(device__virtual_chassis=self.virtual_chassis, mgmt_only=False)
|
||||
return Interface.objects.filter(filter)
|
||||
|
Loading…
Reference in New Issue
Block a user