def invalidate_cache(user, size=None):
 sizes = set(settings.AVATAR_AUTO_GENERATE_SIZES)
 if (size is not None):
  sizes.add(size)
 for prefix in cached_funcs:
  for size in sizes:
   cache.delete(get_cache_key(user, size, prefix))

def invalidate_cache ( user , size = None ) : sizes = set ( settings . AVATAR_AUTO_GENERATE_SIZES ) if ( size is not None ) : sizes . add ( size ) for prefix in cached_funcs : for size in sizes : cache . delete ( get_cache_key ( user , size , prefix ) )
function to be called when saving or changing an users avatars .