From 2295a29d81df9d9e0ca0f65e6e4f14a1f5cc357c Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Tue, 18 Jun 2024 12:02:40 +0200 Subject: [PATCH] :recycle: Rename existing logic rule check DMN action checks are also logic rule checks, so the collector function and context variables are renamed to better cover what they actually detect. --- src/openforms/emails/digest.py | 6 ++-- src/openforms/emails/tasks.py | 6 ++-- .../emails/templates/emails/admin_digest.html | 10 +++---- .../emails/tests/test_digest_functions.py | 28 ++++++++++--------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/openforms/emails/digest.py b/src/openforms/emails/digest.py index 1400a9944d..0b653c804c 100644 --- a/src/openforms/emails/digest.py +++ b/src/openforms/emails/digest.py @@ -124,7 +124,7 @@ def admin_link(self) -> str: @dataclass -class InvalidLogicRule: +class InvalidLogicVariable: variable: str form_name: str form_id: int @@ -366,7 +366,7 @@ def collect_invalid_registration_backends() -> list[InvalidRegistrationBackend]: return invalid_registration_backends -def collect_invalid_logic_rules() -> list[InvalidLogicRule]: +def collect_invalid_logic_variables() -> list[InvalidLogicVariable]: forms = Form.objects.live().iterator() static_variables = { var.key: {"source": var.source, "type": var.data_type} @@ -409,7 +409,7 @@ def collect_invalid_logic_rules() -> list[InvalidLogicRule]: def _report(): invalid_logic_rules.append( - InvalidLogicRule( + InvalidLogicVariable( variable=var.key, form_name=form.admin_name, form_id=form.id, diff --git a/src/openforms/emails/tasks.py b/src/openforms/emails/tasks.py index d5a7bb15a5..0443b4987a 100644 --- a/src/openforms/emails/tasks.py +++ b/src/openforms/emails/tasks.py @@ -15,7 +15,7 @@ collect_failed_prefill_plugins, collect_failed_registrations, collect_invalid_certificates, - collect_invalid_logic_rules, + collect_invalid_logic_variables, collect_invalid_registration_backends, ) from .utils import send_mail_html @@ -32,7 +32,7 @@ def get_context_data(self) -> dict[str, Any]: broken_configurations = collect_broken_configurations() invalid_certificates = collect_invalid_certificates() invalid_registration_backends = collect_invalid_registration_backends() - invalid_logic_rules = collect_invalid_logic_rules() + invalid_logic_variables = collect_invalid_logic_variables() return { "failed_emails": failed_emails, @@ -41,7 +41,7 @@ def get_context_data(self) -> dict[str, Any]: "broken_configurations": broken_configurations, "invalid_certificates": invalid_certificates, "invalid_registration_backends": invalid_registration_backends, - "invalid_logic_rules": invalid_logic_rules, + "invalid_logic_variables": invalid_logic_variables, } def render(self) -> str: diff --git a/src/openforms/emails/templates/emails/admin_digest.html b/src/openforms/emails/templates/emails/admin_digest.html index fcbf162e63..4cb0e69ea4 100644 --- a/src/openforms/emails/templates/emails/admin_digest.html +++ b/src/openforms/emails/templates/emails/admin_digest.html @@ -110,7 +110,6 @@
{% trans "Found invalid certificates" %}
{% if invalid_registration_backends %}
{% trans "Registration backends problems" %}