From 2094bcc08261d58d020906f26fc6a0b6fdcaf076 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Fri, 20 Nov 2026 02:31:37 -0500 Subject: [PATCH 1/2] Apply suggested fix to django_forms_workflows/workflow_builder_views.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- django_forms_workflows/workflow_builder_views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django_forms_workflows/workflow_builder_views.py b/django_forms_workflows/workflow_builder_views.py index e666591..73e71ce 100644 --- a/django_forms_workflows/workflow_builder_views.py +++ b/django_forms_workflows/workflow_builder_views.py @@ -2629,7 +2629,12 @@ def graph_action_ids(graph): rule_id_text = str(raw_rule_id).strip() if not rule_id_text.isascii() or not rule_id_text.isdigit(): raise BuilderValidationError("Invalid notification rule identifier.") - normalized_rule_id = int(rule_id_text) + try: + normalized_rule_id = int(rule_id_text) + except ValueError as exc: + raise BuilderValidationError( + "Invalid notification rule identifier." + ) from exc if not 0 < normalized_rule_id <= 2**63 - 1: raise BuilderValidationError("Invalid notification rule identifier.") rule_obj = existing_notification_rules.get(normalized_rule_id) From c3ce24d8fc772a8150c2df7d7f34bb0e1cbb2cba Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Fri, 20 Nov 2026 02:31:38 -0500 Subject: [PATCH 2/2] Apply suggested fix to django_forms_workflows/workflow_builder_views.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- .../workflow_builder_views.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/django_forms_workflows/workflow_builder_views.py b/django_forms_workflows/workflow_builder_views.py index 73e71ce..d2cc95e 100644 --- a/django_forms_workflows/workflow_builder_views.py +++ b/django_forms_workflows/workflow_builder_views.py @@ -704,12 +704,26 @@ def is_valid_field_name(value): f"Notification rule {rule_index} references workflow stage ID {stage_id}, but that stage is not present in the submitted builder graph." ) + notify_submitter = rule_data.get("notify_submitter") + notify_stage_assignees = rule_data.get("notify_stage_assignees") + notify_stage_groups = rule_data.get("notify_stage_groups") + + for flag_name, flag_value in ( + ("notify_submitter", notify_submitter), + ("notify_stage_assignees", notify_stage_assignees), + ("notify_stage_groups", notify_stage_groups), + ): + if flag_value is not None and not isinstance(flag_value, bool): + add_error( + f"Notification rule {rule_index} field '{flag_name}' must be a boolean." + ) + has_recipients = bool( - rule_data.get("notify_submitter") + (notify_submitter is True) or rule_data.get("email_field") or rule_data.get("static_emails") - or rule_data.get("notify_stage_assignees") - or rule_data.get("notify_stage_groups") + or (notify_stage_assignees is True) + or (notify_stage_groups is True) or (rule_data.get("notify_groups") or []) ) if not has_recipients: