@receiver(models.signals.post_save, sender=CreditCourse)
@receiver(models.signals.post_delete, sender=CreditCourse)
def invalidate_credit_courses_cache(sender, **kwargs):
 cache.delete(CreditCourse.CREDIT_COURSES_CACHE_KEY)

@ receiver ( models . signals . post_save , sender = CreditCourse ) @ receiver ( models . signals . post_delete , sender = CreditCourse ) def invalidate_credit_courses_cache ( sender , ** kwargs ) : cache . delete ( CreditCourse . CREDIT_COURSES_CACHE_KEY )
invalidate the cache of credit courses .