Migrate Notifications interface patterns

This commit is contained in:
2026-08-03 15:33:49 +02:00
parent 3b1a87b3e2
commit ad6a31f68b
13 changed files with 825 additions and 104 deletions
@@ -322,6 +322,10 @@ def update_notification(
notification.read_at = notification.read_at or now
notification.acknowledged_at = notification.acknowledged_at or now
elif payload.status == "cancelled":
if notification.status not in PENDING_STATUSES | {"paused"}:
raise NotificationError(
f"Notification cannot be cancelled from status {notification.status}"
)
notification.status = "cancelled"
notification.cancelled_at = notification.cancelled_at or now
if payload.metadata is not None: