from django.conf import settings
from django.core.cache import caches
from django.db.models.signals import post_save
from django.dispatch import receiver

from .models import StyleSettings


@receiver(post_save, sender=StyleSettings)
def clear_compress_backend(*_, **__):
    caches[settings.COMPRESS_CACHE_BACKEND].clear()
