from django.core.cache import cache
from django.dispatch import receiver

from ocyan.plugin.oscar.signals import order_ready

from ocyan.plugin.oscar_partner.partner.constants import LOCAL_VAT_APPLICABLE_KEY


@receiver(order_ready)
def clear_local_vat_cache(sender, **kwargs):  # pylint: disable=unused-argument
    cache.delete(LOCAL_VAT_APPLICABLE_KEY)
