Resolve notification worker items to tenants

This commit is contained in:
2026-08-04 09:29:36 +02:00
parent 3c71422b90
commit bb59342b24
3 changed files with 25 additions and 1 deletions
@@ -12,6 +12,17 @@ class SqlNotificationDispatchProvider(NotificationDispatchProvider):
self._settings = context.settings
self._registry = context.registry
def tenant_id_for_notification(
self,
session: object,
*,
notification_id: str,
) -> str | None:
from govoplan_notifications.backend.db.models import NotificationMessage
notification = session.get(NotificationMessage, notification_id) # type: ignore[attr-defined]
return notification.tenant_id if notification is not None else None
def enqueue_notification(
self,
session: object,