def invalidate_cache(sender, instance, created=True, **kwargs):
    """
    Invalidate caching on places related to the lock icon in the stats table
    row.
    """
    if created:
        logger.debug("lock-addon: Invalidating cache: %s" % instance)

        invalidate_template_cache('resource_details_lang',
            instance.rlstats.resource.project.slug,
            instance.rlstats.resource.slug,
            instance.rlstats.language.code)

        invalidate_template_cache('resource_details',
            instance.rlstats.resource.project.slug,
            instance.rlstats.resource.slug)

        team = Team.objects.get_or_none(instance.rlstats.resource.project,
            instance.rlstats.language.code)
        if team:
            invalidate_template_cache('team_details', team.id,
                instance.rlstats.resource.id)
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/addons/locks/handlers.py/invalidate_cache/original