admin: don't show policy as unbound when used as validation policy

This commit is contained in:
Jens Langhammer 2020-09-14 15:44:33 +02:00
parent 17a9e02bc0
commit cc8afa8706
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@
<th role="columnheader">
<div>
<div>{{ policy.name }}</div>
{% if not policy.bindings.exists %}
{% if not policy.bindings.exists and not policy.promptstage_set.exists %}
<i class="pf-icon pf-icon-warning-triangle"></i>
<small>{% trans 'Warning: Policy is not assigned.' %}</small>
{% else %}

View File

@ -58,7 +58,7 @@ class AdministrationOverviewView(AdminRequiredMixin, TemplateView):
application=None
)
kwargs["policies_without_binding"] = len(
Policy.objects.filter(bindings__isnull=True)
Policy.objects.filter(bindings__isnull=True, promptstage__isnull=True)
)
kwargs["cached_policies"] = len(cache.keys("policy_*"))
kwargs["cached_flows"] = len(cache.keys("flow_*"))