Migrate Notifications interface patterns
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user