# pylint: skip-file
from django.dispatch import receiver

from wagtail.contrib.search_promotions.models import Query

from oscar_elasticsearch.search.signals import query_hit


@receiver(query_hit)
def handle_query_hit(sender, querystring, **kwargs):  # pylint: disable=unused-argument
    query_recorder = Query.get(querystring)
    query_recorder.add_hit()
