Compare commits

..

7 Commits

Author SHA1 Message Date
Arthur
c4c3518bb4 change ordering field, remove front-end changes 2026-01-20 13:45:17 -08:00
Arthur
5a1282e326 Merge branch 'main' into 20911-dropdown
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CI / build (20.x, 3.13) (push) Has been cancelled
CI / build (20.x, 3.14) (push) Has been cancelled
2026-01-14 13:39:45 -08:00
Arthur
cb13eb277f use correct node version 2026-01-14 13:36:33 -08:00
Arthur
24642be351 cleanup 2026-01-08 17:08:10 -08:00
Arthur
89af9efd85 cleanup 2026-01-08 17:04:00 -08:00
Arthur
99d678502f cleanup 2026-01-08 16:23:47 -08:00
Arthur
e6300ee06d Fix TomSelect dropdown ordering 2026-01-08 16:17:40 -08:00
2 changed files with 7 additions and 11 deletions

View File

@@ -1273,7 +1273,7 @@ class ModuleBay(ModularComponentModel, TrackingModelMixin, MPTTModel):
verbose_name_plural = _('module bays') verbose_name_plural = _('module bays')
class MPTTMeta: class MPTTMeta:
order_insertion_by = ('module',) order_insertion_by = ('name',)
def clean(self): def clean(self):
super().clean() super().clean()

View File

@@ -211,16 +211,12 @@ def sync_cached_scope_fields(instance, created, **kwargs):
for model in (Prefix, Cluster, WirelessLAN): for model in (Prefix, Cluster, WirelessLAN):
qs = model.objects.filter(**filters) qs = model.objects.filter(**filters)
# Bulk update cached fields to avoid O(N) performance issues with large datasets.
# This does not trigger post_save signals, avoiding spurious change log entries.
objects_to_update = []
for obj in qs: for obj in qs:
# Recompute cache using the same logic as save() # Recompute cache using the same logic as save()
obj.cache_related_objects() obj.cache_related_objects()
objects_to_update.append(obj) obj.save(update_fields=[
'_location',
if objects_to_update: '_site',
model.objects.bulk_update( '_site_group',
objects_to_update, '_region',
['_location', '_site', '_site_group', '_region'] ])
)