Skip to content

Commit 57e78d2

Browse files
committed
fix: remove stale notify_assignees references from WorkflowNotification
The clean() and __str__ methods on WorkflowNotification referenced a notify_assignees field that was never added to the model, causing AttributeError crashes on any admin page rendering a WorkflowNotification. Removed the stale references and updated the class docstring to reflect that assignee notification is now controlled at the stage level via notify_assignee_on_final_decision.
1 parent 6e36933 commit 57e78d2

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.42.1] - 2026-03-31
11+
12+
### Fixed
13+
- **WorkflowNotification `__str__` and `clean()` crash** — Removed stale references to a `notify_assignees` field that was never added to the model, causing `AttributeError` on any admin page that rendered a `WorkflowNotification` instance. Updated docstring to reflect the stage-level flag.
14+
1015
## [0.42.0] - 2026-03-31
1116

1217
### Added

django_forms_workflows/models.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,14 +1078,13 @@ class WorkflowNotification(models.Model):
10781078
Recipients are the union of:
10791079
10801080
* ``notify_submitter`` — if True, the person who submitted the form is always included.
1081-
* ``notify_assignees`` — if True, all dynamically-assigned workflow approvers
1082-
(resolved via ``assignee_form_field`` on any stage) are included.
1083-
Only effective for approval and rejection notifications.
1081+
* Dynamically-assigned approvers from stages with
1082+
``notify_assignee_on_final_decision=True`` (automatic for approval/rejection).
10841083
* ``email_field`` — slug of the form field whose value is the recipient email
10851084
(resolved from ``form_data`` at send time, varies per submission).
10861085
* ``static_emails`` — comma-separated fixed addresses always included.
10871086
1088-
At least one of the four must be set.
1087+
At least one of the three must be set.
10891088
10901089
``conditions`` (same JSON format as ``WorkflowStage.trigger_conditions``)
10911090
are evaluated against ``form_data`` before sending; leave blank to always send.
@@ -1166,21 +1165,18 @@ def clean(self):
11661165

11671166
if (
11681167
not self.notify_submitter
1169-
and not self.notify_assignees
11701168
and not self.email_field
11711169
and not self.static_emails
11721170
):
11731171
raise ValidationError(
11741172
"At least one recipient source must be set: "
1175-
"'Notify submitter', 'Notify assignees', 'Email field', or 'Static emails'."
1173+
"'Notify submitter', 'Email field', or 'Static emails'."
11761174
)
11771175

11781176
def __str__(self) -> str:
11791177
parts = []
11801178
if self.notify_submitter:
11811179
parts.append("submitter")
1182-
if self.notify_assignees:
1183-
parts.append("assignees")
11841180
if self.email_field:
11851181
parts.append(f"field:{self.email_field}")
11861182
if self.static_emails:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-forms-workflows"
3-
version = "0.42.0"
3+
version = "0.42.1"
44
description = "Enterprise-grade, database-driven form builder with approval workflows and external data integration"
55
license = "LGPL-3.0-only"
66
readme = "README.md"

0 commit comments

Comments
 (0)