flows: FlowStageBinding: rename .flow to .target to fix select_subclasses()

This commit is contained in:
Jens Langhammer
2020-07-03 23:34:44 +02:00
parent dd74b73b4f
commit d3b0992456
35 changed files with 119 additions and 81 deletions

View File

@ -25,13 +25,13 @@ def invalidate_flow_cache(sender, instance, **_):
total = delete_cache_prefix(f"{cache_key(instance)}*")
LOGGER.debug("Invalidating Flow cache", flow=instance, len=total)
if isinstance(instance, FlowStageBinding):
total = delete_cache_prefix(f"{cache_key(instance.flow)}*")
total = delete_cache_prefix(f"{cache_key(instance.target)}*")
LOGGER.debug(
"Invalidating Flow cache from FlowStageBinding", binding=instance, len=total
)
if isinstance(instance, Stage):
total = 0
for binding in FlowStageBinding.objects.filter(stage=instance):
prefix = cache_key(binding.flow)
prefix = cache_key(binding.target)
total += delete_cache_prefix(f"{prefix}*")
LOGGER.debug("Invalidating Flow cache from Stage", stage=instance, len=total)