mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-15 16:22:18 -06:00
* Enable E501 rule * Configure ruff formatter * Reformat migration files to fix line length violations * Fix various E501 errors * Move table template code to template_code.py & ignore E501 errors * Reformat raw SQL
This commit is contained in:
@@ -532,7 +532,10 @@ def update_interface_bridges(device, interface_templates, module=None):
|
||||
interface = Interface.objects.get(device=device, name=interface_template.resolve_name(module=module))
|
||||
|
||||
if interface_template.bridge:
|
||||
interface.bridge = Interface.objects.get(device=device, name=interface_template.bridge.resolve_name(module=module))
|
||||
interface.bridge = Interface.objects.get(
|
||||
device=device,
|
||||
name=interface_template.bridge.resolve_name(module=module)
|
||||
)
|
||||
interface.full_clean()
|
||||
interface.save()
|
||||
|
||||
@@ -909,7 +912,10 @@ class Device(
|
||||
})
|
||||
if self.primary_ip4.assigned_object in vc_interfaces:
|
||||
pass
|
||||
elif self.primary_ip4.nat_inside is not None and self.primary_ip4.nat_inside.assigned_object in vc_interfaces:
|
||||
elif (
|
||||
self.primary_ip4.nat_inside is not None and
|
||||
self.primary_ip4.nat_inside.assigned_object in vc_interfaces
|
||||
):
|
||||
pass
|
||||
else:
|
||||
raise ValidationError({
|
||||
@@ -924,7 +930,10 @@ class Device(
|
||||
})
|
||||
if self.primary_ip6.assigned_object in vc_interfaces:
|
||||
pass
|
||||
elif self.primary_ip6.nat_inside is not None and self.primary_ip6.nat_inside.assigned_object in vc_interfaces:
|
||||
elif (
|
||||
self.primary_ip6.nat_inside is not None and
|
||||
self.primary_ip6.nat_inside.assigned_object in vc_interfaces
|
||||
):
|
||||
pass
|
||||
else:
|
||||
raise ValidationError({
|
||||
@@ -978,9 +987,10 @@ class Device(
|
||||
|
||||
if hasattr(self, 'vc_master_for') and self.vc_master_for and self.vc_master_for != self.virtual_chassis:
|
||||
raise ValidationError({
|
||||
'virtual_chassis': _('Device cannot be removed from virtual chassis {virtual_chassis} because it is currently designated as its master.').format(
|
||||
virtual_chassis=self.vc_master_for
|
||||
)
|
||||
'virtual_chassis': _(
|
||||
'Device cannot be removed from virtual chassis {virtual_chassis} because it is currently '
|
||||
'designated as its master.'
|
||||
).format(virtual_chassis=self.vc_master_for)
|
||||
})
|
||||
|
||||
def _instantiate_components(self, queryset, bulk_create=True):
|
||||
|
||||
Reference in New Issue
Block a user