policy(minor): lookup correct policy subclass

This commit is contained in:
Jens Langhammer 2019-10-02 22:28:58 +02:00
parent de0b137b1e
commit 920e705d75
1 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,9 @@ class PolicyEngine:
LOGGER.debug("Taking result from cache for %s", policy.pk.hex) LOGGER.debug("Taking result from cache for %s", policy.pk.hex)
cached_policies.append(cached_policy) cached_policies.append(cached_policy)
else: else:
LOGGER.debug("Looking up real class of policy...")
# TODO: Rewrite this to lookup all policies at once
policy = Policy.objects.get_subclass(pk=policy.id)
LOGGER.debug("Evaluating policy %s", policy.pk.hex) LOGGER.debug("Evaluating policy %s", policy.pk.hex)
our_end, task_end = Pipe(False) our_end, task_end = Pipe(False)
task = PolicyTask() task = PolicyTask()