mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-05 07:08:16 -06:00
17419 rebuild module bay tree on upgrade
This commit is contained in:
parent
6d0a3485a1
commit
d716d29c0a
20
netbox/dcim/migrations/0191_module_bay_rebuild.py
Normal file
20
netbox/dcim/migrations/0191_module_bay_rebuild.py
Normal file
@ -0,0 +1,20 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def rebuild_mptt(apps, schema_editor):
|
||||
ModuleBay = apps.get_model('dcim', 'ModuleBay')
|
||||
ModuleBay.objects.rebuild()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('dcim', '0190_nested_modules'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=rebuild_mptt,
|
||||
reverse_code=migrations.RunPython.noop
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue
Block a user