from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from settings.models import Setting
from django.core.cache import cache


@receiver([post_save, post_delete], sender=Setting)
def invalidate_setting_cache(sender, instance, **kwargs):
    # Sadece active_setting cache'ini temizle
    cache.delete('active_setting')
    print('Cache cleared for active_setting')
