From cc8afa870660c4a92159663780e276771c1f0045 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 14 Sep 2020 15:44:33 +0200 Subject: [PATCH] admin: don't show policy as unbound when used as validation policy --- passbook/admin/templates/administration/policy/list.html | 2 +- passbook/admin/views/overview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/admin/templates/administration/policy/list.html b/passbook/admin/templates/administration/policy/list.html index bcbd15e50..98fc3f4cf 100644 --- a/passbook/admin/templates/administration/policy/list.html +++ b/passbook/admin/templates/administration/policy/list.html @@ -55,7 +55,7 @@
{{ policy.name }}
- {% if not policy.bindings.exists %} + {% if not policy.bindings.exists and not policy.promptstage_set.exists %} {% trans 'Warning: Policy is not assigned.' %} {% else %} diff --git a/passbook/admin/views/overview.py b/passbook/admin/views/overview.py index 693e4e744..3092e9320 100644 --- a/passbook/admin/views/overview.py +++ b/passbook/admin/views/overview.py @@ -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_*"))