From 6a5aced4bc1b58ed54682ff06df4d29f0abf7445 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 21 Jan 2026 12:28:01 -0800 Subject: [PATCH] fix migration --- netbox/dcim/migrations/0226_modulebay_rebuild_tree.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/netbox/dcim/migrations/0226_modulebay_rebuild_tree.py b/netbox/dcim/migrations/0226_modulebay_rebuild_tree.py index 10b1177e7..840215335 100644 --- a/netbox/dcim/migrations/0226_modulebay_rebuild_tree.py +++ b/netbox/dcim/migrations/0226_modulebay_rebuild_tree.py @@ -1,6 +1,4 @@ from django.db import migrations -import mptt -import mptt.managers def rebuild_mptt(apps, schema_editor): @@ -8,12 +6,8 @@ def rebuild_mptt(apps, schema_editor): Rebuild the MPTT tree for ModuleBay to apply new ordering by 'name' instead of 'module'. """ - manager = mptt.managers.TreeManager() ModuleBay = apps.get_model('dcim', 'ModuleBay') - manager.model = ModuleBay - mptt.register(ModuleBay) - manager.contribute_to_class(ModuleBay, 'objects') - manager.rebuild() + ModuleBay.objects.rebuild() class Migration(migrations.Migration):