From d1672f8818de1f712854dd22011c8a7b99e9a193 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 31 Jan 2022 16:15:40 -0500 Subject: [PATCH] Move nullable_fields out of Meta for bulk edit forms --- netbox/circuits/forms/bulk_edit.py | 24 ++-- netbox/dcim/forms/bulk_edit.py | 139 ++++++++--------------- netbox/extras/forms/bulk_edit.py | 15 +-- netbox/ipam/forms/bulk_edit.py | 69 ++++------- netbox/tenancy/forms/bulk_edit.py | 15 +-- netbox/utilities/forms/forms.py | 7 +- netbox/virtualization/forms/bulk_edit.py | 27 ++--- netbox/wireless/forms/bulk_edit.py | 13 ++- 8 files changed, 110 insertions(+), 199 deletions(-) diff --git a/netbox/circuits/forms/bulk_edit.py b/netbox/circuits/forms/bulk_edit.py index f17df1302..9c20a2fe7 100644 --- a/netbox/circuits/forms/bulk_edit.py +++ b/netbox/circuits/forms/bulk_edit.py @@ -47,10 +47,9 @@ class ProviderBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments', - ) + nullable_fields = ( + 'asn', 'account', 'portal_url', 'noc_contact', 'admin_contact', 'comments', + ) class ProviderNetworkBulkEditForm(NetBoxModelBulkEditForm): @@ -75,10 +74,9 @@ class ProviderNetworkBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'service_id', 'description', 'comments', - ) + nullable_fields = ( + 'service_id', 'description', 'comments', + ) class CircuitTypeBulkEditForm(NetBoxModelBulkEditForm): @@ -91,8 +89,7 @@ class CircuitTypeBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class CircuitBulkEditForm(NetBoxModelBulkEditForm): @@ -131,7 +128,6 @@ class CircuitBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'tenant', 'commit_rate', 'description', 'comments', - ) + nullable_fields = ( + 'tenant', 'commit_rate', 'description', 'comments', + ) diff --git a/netbox/dcim/forms/bulk_edit.py b/netbox/dcim/forms/bulk_edit.py index 13e9d945b..a126d22f9 100644 --- a/netbox/dcim/forms/bulk_edit.py +++ b/netbox/dcim/forms/bulk_edit.py @@ -71,8 +71,7 @@ class RegionBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'description') + nullable_fields = ('parent', 'description') class SiteGroupBulkEditForm(NetBoxModelBulkEditForm): @@ -89,8 +88,7 @@ class SiteGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'description') + nullable_fields = ('parent', 'description') class SiteBulkEditForm(NetBoxModelBulkEditForm): @@ -131,10 +129,9 @@ class SiteBulkEditForm(NetBoxModelBulkEditForm): widget=StaticSelect() ) - class Meta: - nullable_fields = ( - 'region', 'group', 'tenant', 'asns', 'description', 'time_zone', - ) + nullable_fields = ( + 'region', 'group', 'tenant', 'asns', 'description', 'time_zone', + ) class LocationBulkEditForm(NetBoxModelBulkEditForm): @@ -162,8 +159,7 @@ class LocationBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'tenant', 'description') + nullable_fields = ('parent', 'tenant', 'description') class RackRoleBulkEditForm(NetBoxModelBulkEditForm): @@ -179,8 +175,7 @@ class RackRoleBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('color', 'description') + nullable_fields = ('color', 'description') class RackBulkEditForm(NetBoxModelBulkEditForm): @@ -277,10 +272,9 @@ class RackBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'location', 'tenant', 'role', 'serial', 'asset_tag', 'outer_width', 'outer_depth', 'outer_unit', 'comments', - ) + nullable_fields = ( + 'location', 'tenant', 'role', 'serial', 'asset_tag', 'outer_width', 'outer_depth', 'outer_unit', 'comments', + ) class RackReservationBulkEditForm(NetBoxModelBulkEditForm): @@ -315,8 +309,7 @@ class ManufacturerBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm): @@ -346,8 +339,7 @@ class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm): widget=StaticSelect() ) - class Meta: - nullable_fields = ('part_number', 'airflow') + nullable_fields = ('part_number', 'airflow') class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm): @@ -363,8 +355,7 @@ class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('part_number',) + nullable_fields = ('part_number',) class DeviceRoleBulkEditForm(NetBoxModelBulkEditForm): @@ -385,8 +376,7 @@ class DeviceRoleBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('color', 'description') + nullable_fields = ('color', 'description') class PlatformBulkEditForm(NetBoxModelBulkEditForm): @@ -408,8 +398,7 @@ class PlatformBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('manufacturer', 'napalm_driver', 'description') + nullable_fields = ('manufacturer', 'napalm_driver', 'description') class DeviceBulkEditForm(NetBoxModelBulkEditForm): @@ -467,10 +456,9 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm): label='Serial Number' ) - class Meta: - nullable_fields = ( - 'tenant', 'platform', 'serial', 'airflow', - ) + nullable_fields = ( + 'tenant', 'platform', 'serial', 'airflow', + ) class ModuleBulkEditForm(NetBoxModelBulkEditForm): @@ -495,8 +483,7 @@ class ModuleBulkEditForm(NetBoxModelBulkEditForm): label='Serial Number' ) - class Meta: - nullable_fields = ('serial',) + nullable_fields = ('serial',) class CableBulkEditForm(NetBoxModelBulkEditForm): @@ -538,10 +525,9 @@ class CableBulkEditForm(NetBoxModelBulkEditForm): widget=StaticSelect() ) - class Meta: - nullable_fields = ( - 'type', 'status', 'tenant', 'label', 'color', 'length', - ) + nullable_fields = ( + 'type', 'status', 'tenant', 'label', 'color', 'length', + ) def clean(self): super().clean() @@ -565,8 +551,7 @@ class VirtualChassisBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('domain',) + nullable_fields = ('domain',) class PowerPanelBulkEditForm(NetBoxModelBulkEditForm): @@ -604,8 +589,7 @@ class PowerPanelBulkEditForm(NetBoxModelBulkEditForm): } ) - class Meta: - nullable_fields = ('location',) + nullable_fields = ('location',) class PowerFeedBulkEditForm(NetBoxModelBulkEditForm): @@ -663,10 +647,7 @@ class PowerFeedBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'location', 'comments', - ) + nullable_fields = ('location', 'comments') # @@ -688,8 +669,7 @@ class ConsolePortTemplateBulkEditForm(BulkEditForm): widget=StaticSelect() ) - class Meta: - nullable_fields = ('label', 'type', 'description') + nullable_fields = ('label', 'type', 'description') class ConsoleServerPortTemplateBulkEditForm(BulkEditForm): @@ -710,8 +690,7 @@ class ConsoleServerPortTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'type', 'description') + nullable_fields = ('label', 'type', 'description') class PowerPortTemplateBulkEditForm(BulkEditForm): @@ -742,8 +721,7 @@ class PowerPortTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'type', 'maximum_draw', 'allocated_draw', 'description') + nullable_fields = ('label', 'type', 'maximum_draw', 'allocated_draw', 'description') class PowerOutletTemplateBulkEditForm(BulkEditForm): @@ -779,8 +757,7 @@ class PowerOutletTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'type', 'power_port', 'feed_leg', 'description') + nullable_fields = ('label', 'type', 'power_port', 'feed_leg', 'description') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -817,8 +794,7 @@ class InterfaceTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class FrontPortTemplateBulkEditForm(BulkEditForm): @@ -842,8 +818,7 @@ class FrontPortTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class RearPortTemplateBulkEditForm(BulkEditForm): @@ -867,8 +842,7 @@ class RearPortTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ModuleBayTemplateBulkEditForm(BulkEditForm): @@ -884,8 +858,7 @@ class ModuleBayTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'position', 'description') + nullable_fields = ('label', 'position', 'description') class DeviceBayTemplateBulkEditForm(BulkEditForm): @@ -901,8 +874,7 @@ class DeviceBayTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class InventoryItemTemplateBulkEditForm(BulkEditForm): @@ -926,8 +898,7 @@ class InventoryItemTemplateBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description') + nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description') # @@ -947,8 +918,7 @@ class ConsolePortBulkEditForm( widget=BulkEditNullBooleanSelect ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class ConsoleServerPortBulkEditForm( @@ -964,8 +934,7 @@ class ConsoleServerPortBulkEditForm( widget=BulkEditNullBooleanSelect ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class PowerPortBulkEditForm( @@ -981,8 +950,7 @@ class PowerPortBulkEditForm( widget=BulkEditNullBooleanSelect ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class PowerOutletBulkEditForm( @@ -1004,8 +972,7 @@ class PowerOutletBulkEditForm( widget=BulkEditNullBooleanSelect ) - class Meta: - nullable_fields = ('label', 'type', 'feed_leg', 'power_port', 'description') + nullable_fields = ('label', 'type', 'feed_leg', 'power_port', 'description') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -1084,12 +1051,10 @@ class InterfaceBulkEditForm( label='VRF' ) - class Meta: - nullable_fields = ( - 'label', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'description', 'mode', - 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'untagged_vlan', 'tagged_vlans', - 'vrf', - ) + nullable_fields = ( + 'label', 'parent', 'bridge', 'lag', 'speed', 'duplex', 'mac_address', 'wwn', 'mtu', 'description', 'mode', + 'rf_channel', 'rf_channel_frequency', 'rf_channel_width', 'tx_power', 'untagged_vlan', 'tagged_vlans', 'vrf', + ) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -1154,8 +1119,7 @@ class FrontPortBulkEditForm( widget=forms.MultipleHiddenInput() ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class RearPortBulkEditForm( @@ -1167,8 +1131,7 @@ class RearPortBulkEditForm( widget=forms.MultipleHiddenInput() ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class ModuleBayBulkEditForm( @@ -1180,8 +1143,7 @@ class ModuleBayBulkEditForm( widget=forms.MultipleHiddenInput() ) - class Meta: - nullable_fields = ('label', 'position', 'description') + nullable_fields = ('label', 'position', 'description') class DeviceBayBulkEditForm( @@ -1193,8 +1155,7 @@ class DeviceBayBulkEditForm( widget=forms.MultipleHiddenInput() ) - class Meta: - nullable_fields = ('label', 'description') + nullable_fields = ('label', 'description') class InventoryItemBulkEditForm( @@ -1214,8 +1175,7 @@ class InventoryItemBulkEditForm( required=False ) - class Meta: - nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description') + nullable_fields = ('label', 'role', 'manufacturer', 'part_id', 'description') # @@ -1235,5 +1195,4 @@ class InventoryItemRoleBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('color', 'description') + nullable_fields = ('color', 'description') diff --git a/netbox/extras/forms/bulk_edit.py b/netbox/extras/forms/bulk_edit.py index 362592ace..b09bfc612 100644 --- a/netbox/extras/forms/bulk_edit.py +++ b/netbox/extras/forms/bulk_edit.py @@ -33,8 +33,7 @@ class CustomFieldBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class CustomLinkBulkEditForm(BulkEditForm): @@ -92,8 +91,7 @@ class ExportTemplateBulkEditForm(BulkEditForm): widget=BulkEditNullBooleanSelect() ) - class Meta: - nullable_fields = ('description', 'mime_type', 'file_extension') + nullable_fields = ('description', 'mime_type', 'file_extension') class WebhookBulkEditForm(BulkEditForm): @@ -135,8 +133,7 @@ class WebhookBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('secret', 'conditions', 'ca_file_path') + nullable_fields = ('secret', 'conditions', 'ca_file_path') class TagBulkEditForm(BulkEditForm): @@ -152,8 +149,7 @@ class TagBulkEditForm(BulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ConfigContextBulkEditForm(BulkEditForm): @@ -174,8 +170,7 @@ class ConfigContextBulkEditForm(BulkEditForm): max_length=100 ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class JournalEntryBulkEditForm(BulkEditForm): diff --git a/netbox/ipam/forms/bulk_edit.py b/netbox/ipam/forms/bulk_edit.py index 637051318..9a56501d2 100644 --- a/netbox/ipam/forms/bulk_edit.py +++ b/netbox/ipam/forms/bulk_edit.py @@ -49,10 +49,7 @@ class VRFBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'tenant', 'description', - ) + nullable_fields = ('tenant', 'description') class RouteTargetBulkEditForm(NetBoxModelBulkEditForm): @@ -69,10 +66,7 @@ class RouteTargetBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'tenant', 'description', - ) + nullable_fields = ('tenant', 'description') class RIRBulkEditForm(NetBoxModelBulkEditForm): @@ -89,8 +83,7 @@ class RIRBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('is_private', 'description') + nullable_fields = ('is_private', 'description') class ASNBulkEditForm(NetBoxModelBulkEditForm): @@ -116,13 +109,7 @@ class ASNBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'date_added', 'description', - ) - widgets = { - 'date_added': DatePicker(), - } + nullable_fields = ('date_added', 'description') class AggregateBulkEditForm(NetBoxModelBulkEditForm): @@ -147,13 +134,7 @@ class AggregateBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'date_added', 'description', - ) - widgets = { - 'date_added': DatePicker(), - } + nullable_fields = ('date_added', 'description') class RoleBulkEditForm(NetBoxModelBulkEditForm): @@ -169,8 +150,7 @@ class RoleBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class PrefixBulkEditForm(NetBoxModelBulkEditForm): @@ -232,10 +212,9 @@ class PrefixBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'site', 'vrf', 'tenant', 'role', 'description', - ) + nullable_fields = ( + 'site', 'vrf', 'tenant', 'role', 'description', + ) class IPRangeBulkEditForm(NetBoxModelBulkEditForm): @@ -266,10 +245,9 @@ class IPRangeBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'vrf', 'tenant', 'role', 'description', - ) + nullable_fields = ( + 'vrf', 'tenant', 'role', 'description', + ) class IPAddressBulkEditForm(NetBoxModelBulkEditForm): @@ -311,10 +289,9 @@ class IPAddressBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'vrf', 'role', 'tenant', 'dns_name', 'description', - ) + nullable_fields = ( + 'vrf', 'role', 'tenant', 'dns_name', 'description', + ) class FHRPGroupBulkEditForm(NetBoxModelBulkEditForm): @@ -348,8 +325,7 @@ class FHRPGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('auth_type', 'auth_key', 'description') + nullable_fields = ('auth_type', 'auth_key', 'description') class VLANGroupBulkEditForm(NetBoxModelBulkEditForm): @@ -378,8 +354,7 @@ class VLANGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('site', 'description') + nullable_fields = ('site', 'description') class VLANBulkEditForm(NetBoxModelBulkEditForm): @@ -428,10 +403,9 @@ class VLANBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'site', 'group', 'tenant', 'role', 'description', - ) + nullable_fields = ( + 'site', 'group', 'tenant', 'role', 'description', + ) class ServiceTemplateBulkEditForm(NetBoxModelBulkEditForm): @@ -456,8 +430,7 @@ class ServiceTemplateBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ServiceBulkEditForm(ServiceTemplateBulkEditForm): diff --git a/netbox/tenancy/forms/bulk_edit.py b/netbox/tenancy/forms/bulk_edit.py index f3cc2c33d..a3695c10e 100644 --- a/netbox/tenancy/forms/bulk_edit.py +++ b/netbox/tenancy/forms/bulk_edit.py @@ -31,8 +31,7 @@ class TenantGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'description') + nullable_fields = ('parent', 'description') class TenantBulkEditForm(NetBoxModelBulkEditForm): @@ -45,8 +44,7 @@ class TenantBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('group',) + nullable_fields = ('group',) # @@ -67,8 +65,7 @@ class ContactGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'description') + nullable_fields = ('parent', 'description') class ContactRoleBulkEditForm(NetBoxModelBulkEditForm): @@ -81,8 +78,7 @@ class ContactRoleBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ContactBulkEditForm(NetBoxModelBulkEditForm): @@ -110,5 +106,4 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'comments') + nullable_fields = ('group', 'title', 'phone', 'email', 'address', 'comments') diff --git a/netbox/utilities/forms/forms.py b/netbox/utilities/forms/forms.py index d9a6c2b29..67a2bcb74 100644 --- a/netbox/utilities/forms/forms.py +++ b/netbox/utilities/forms/forms.py @@ -69,14 +69,11 @@ class BulkEditMixin: """ Base form for editing multiple objects in bulk """ + nullable_fields = () + def __init__(self, model, *args, **kwargs): super().__init__(*args, **kwargs) self.model = model - self.nullable_fields = () - - # Copy any nullable fields defined in Meta - if hasattr(self, 'Meta') and hasattr(self.Meta, 'nullable_fields'): - self.nullable_fields = self.Meta.nullable_fields # diff --git a/netbox/virtualization/forms/bulk_edit.py b/netbox/virtualization/forms/bulk_edit.py index dd846029a..e4f6ab25c 100644 --- a/netbox/virtualization/forms/bulk_edit.py +++ b/netbox/virtualization/forms/bulk_edit.py @@ -33,8 +33,7 @@ class ClusterTypeBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ClusterGroupBulkEditForm(NetBoxModelBulkEditForm): @@ -47,8 +46,7 @@ class ClusterGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('description',) + nullable_fields = ('description',) class ClusterBulkEditForm(NetBoxModelBulkEditForm): @@ -89,10 +87,9 @@ class ClusterBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'group', 'site', 'comments', 'tenant', - ) + nullable_fields = ( + 'group', 'site', 'comments', 'tenant', + ) class VirtualMachineBulkEditForm(NetBoxModelBulkEditForm): @@ -144,10 +141,9 @@ class VirtualMachineBulkEditForm(NetBoxModelBulkEditForm): label='Comments' ) - class Meta: - nullable_fields = ( - 'role', 'tenant', 'platform', 'vcpus', 'memory', 'disk', 'comments', - ) + nullable_fields = ( + 'role', 'tenant', 'platform', 'vcpus', 'memory', 'disk', 'comments', + ) class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm): @@ -197,10 +193,9 @@ class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ( - 'parent', 'bridge', 'mtu', 'description', - ) + nullable_fields = ( + 'parent', 'bridge', 'mtu', 'description', + ) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/netbox/wireless/forms/bulk_edit.py b/netbox/wireless/forms/bulk_edit.py index 2d2a3ff14..0a3f0364e 100644 --- a/netbox/wireless/forms/bulk_edit.py +++ b/netbox/wireless/forms/bulk_edit.py @@ -29,8 +29,7 @@ class WirelessLANGroupBulkEditForm(NetBoxModelBulkEditForm): required=False ) - class Meta: - nullable_fields = ('parent', 'description') + nullable_fields = ('parent', 'description') class WirelessLANBulkEditForm(NetBoxModelBulkEditForm): @@ -68,8 +67,9 @@ class WirelessLANBulkEditForm(NetBoxModelBulkEditForm): label='Pre-shared key' ) - class Meta: - nullable_fields = ('ssid', 'group', 'vlan', 'description', 'auth_type', 'auth_cipher', 'auth_psk') + nullable_fields = ( + 'ssid', 'group', 'vlan', 'description', 'auth_type', 'auth_cipher', 'auth_psk', + ) class WirelessLinkBulkEditForm(NetBoxModelBulkEditForm): @@ -102,5 +102,6 @@ class WirelessLinkBulkEditForm(NetBoxModelBulkEditForm): label='Pre-shared key' ) - class Meta: - nullable_fields = ('ssid', 'description', 'auth_type', 'auth_cipher', 'auth_psk') + nullable_fields = ( + 'ssid', 'description', 'auth_type', 'auth_cipher', 'auth_psk', + )