from django.core.management import call_command
from django.dispatch import receiver

from ocyan.core.signals import post_loaddemodata


@receiver(post_loaddemodata)
def update_index(has_unloaded_fixtures, **kwargs):  # pylint: disable=W0613
    if has_unloaded_fixtures:
        call_command("wagtail_update_index")
