1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #11658: Remove reindex command call from search migration

This commit is contained in:
jeremystretch
2023-02-19 18:53:46 -05:00
parent 9efc4689cc
commit e635e3e959

View File

@ -1,27 +1,10 @@
import sys
import uuid
import django.db.models.deletion
import django.db.models.lookups
from django.core import management
from django.db import migrations, models
def reindex(apps, schema_editor):
# Build the search index (except during tests)
if 'test' not in sys.argv:
management.call_command(
'reindex',
'circuits',
'dcim',
'extras',
'ipam',
'tenancy',
'virtualization',
'wireless',
)
class Migration(migrations.Migration):
dependencies = [
@ -57,8 +40,4 @@ class Migration(migrations.Migration):
'ordering': ('weight', 'object_type', 'object_id'),
},
),
migrations.RunPython(
code=reindex,
reverse_code=migrations.RunPython.noop
),
]