Skip to content

Commit 64518b7

Browse files
matteiusclaude
andcommitted
fix: friendly event labels on notification preferences page
NotificationRule.EVENT_TYPES labels include admin-oriented parentheticals ("Workflow Approved (final decision)", "Stage Decision (individual stage completed)") which are useful when authoring rules but noisy on the user-facing preferences page. Render clean labels there, matching the existing "Form Withdrawn" style. Admin-side labels are unchanged. Bumps version to 0.70.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7d196e4 commit 64518b7

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [0.70.1] - 2026-04-16
11+
12+
### Fixed
13+
- **Friendly event labels on notification preferences page** — the model's
14+
`NotificationRule.EVENT_TYPES` labels carry admin-oriented parentheticals
15+
(e.g. "Workflow Approved (final decision)", "Stage Decision (individual
16+
stage completed)") which are useful when authoring rules but noisy for
17+
end users managing their own preferences. The preferences page now
18+
renders clean labels ("Workflow Approved", "Stage Decision", etc.)
19+
consistent with "Form Withdrawn". Admin-facing labels are unchanged.
20+
1021
## [0.70.0] - 2026-04-16
1122

1223
### Added

django_forms_workflows/templates/django_forms_workflows/notification_preferences.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h2 class="mb-1"><i class="bi bi-bell"></i> Notification Preferences</h2>
7979
</td>
8080
<td>
8181
<label for="rule-{{ entry.rule.id }}" class="mb-0">
82-
{{ entry.rule.get_event_display }}
82+
{{ entry.event_label }}
8383
</label>
8484
</td>
8585
<td class="text-muted">

django_forms_workflows/views.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4910,6 +4910,22 @@ def _notification_rules_for_user(user):
49104910
)
49114911

49124912

4913+
# User-facing labels for the preferences page. The model's ``EVENT_TYPES``
4914+
# labels include admin-oriented parentheticals (e.g. "Workflow Approved
4915+
# (final decision)") that make sense when building rules but are noisy for
4916+
# end users managing their own preferences.
4917+
_FRIENDLY_EVENT_LABELS: dict = {
4918+
"submission_received": "Submission Received",
4919+
"approval_request": "Approval Request",
4920+
"stage_decision": "Stage Decision",
4921+
"workflow_approved": "Workflow Approved",
4922+
"workflow_denied": "Workflow Denied",
4923+
"form_withdrawn": "Form Withdrawn",
4924+
"approval_reminder": "Approval Reminder",
4925+
"escalation": "Escalation",
4926+
}
4927+
4928+
49134929
@login_required
49144930
def notification_preferences(request):
49154931
"""Show the signed-in user every NotificationRule they would receive and
@@ -4972,6 +4988,9 @@ def notification_preferences(request):
49724988
"rule": rule,
49734989
"muted": rule.id in muted_rule_ids,
49744990
"reason": _rule_delivery_reason(rule, request.user),
4991+
"event_label": _FRIENDLY_EVENT_LABELS.get(
4992+
rule.event, rule.get_event_display()
4993+
),
49754994
}
49764995
)
49774996

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.70.0"
3+
version = "0.70.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)