Misc cleanup

This commit is contained in:
Jeremy Stretch 2024-08-05 11:29:08 -04:00
parent 16ff3718bb
commit 33514d78b4
2 changed files with 16 additions and 17 deletions

View File

@ -1270,19 +1270,22 @@ class Module(PrimaryModel, ConfigContextModel):
if not disable_replication: if not disable_replication:
create_instances.append(template_instance) create_instances.append(template_instance)
# component_model.objects.bulk_create(create_instances) if component_model is not ModuleBay:
# # Emit the post_save signal for each newly created object component_model.objects.bulk_create(create_instances)
# for component in create_instances: # Emit the post_save signal for each newly created object
# post_save.send( for component in create_instances:
# sender=component_model, post_save.send(
# instance=component, sender=component_model,
# created=True, instance=component,
# raw=False, created=True,
# using='default', raw=False,
# update_fields=None using='default',
# ) update_fields=None
for instance in create_instances: )
instance.save() else:
# ModuleBays must be saved individually for MPTT
for instance in create_instances:
instance.save()
update_fields = ['module'] update_fields = ['module']
component_model.objects.bulk_update(update_instances, update_fields) component_model.objects.bulk_update(update_instances, update_fields)

View File

@ -313,10 +313,6 @@ class ModularDeviceComponentTable(DeviceComponentTable):
verbose_name=_('Inventory Items'), verbose_name=_('Inventory Items'),
) )
class Meta(NetBoxTable.Meta):
pass
# order_by = ('device', 'module', 'name')
class CableTerminationTable(NetBoxTable): class CableTerminationTable(NetBoxTable):
cable = tables.Column( cable = tables.Column(