refactor(reporting): reuse exact principal projection contract
Module Package Release / publish-packages (push) Successful in 15s

Release v0.1.22. Coordinated integrity review: GovOPlaN/govoplan-core#298.
This commit is contained in:
2026-09-08 12:19:40 +02:00
parent 89755e1924
commit 8253bd0dd6
7 changed files with 8 additions and 23 deletions
+1 -16
View File
@@ -10,6 +10,7 @@ import uuid
from sqlalchemy import and_, exists, func, or_
from sqlalchemy.orm import Query, Session
from govoplan_core.core.principal_helpers import principal_actor_ids as _actor_ids
from govoplan_core.core.events import (
EventActorRef,
EventObjectRef,
@@ -884,22 +885,6 @@ def _actor(principal: object) -> str | None:
return None
def _actor_ids(principal: object) -> tuple[str, ...]:
user = getattr(principal, "user", None)
return tuple(
dict.fromkeys(
str(value)
for value in (
getattr(principal, "account_id", None),
getattr(principal, "identity_id", None),
getattr(principal, "membership_id", None),
getattr(user, "id", None),
)
if str(value or "").strip()
)
)
def _principal_tenant(principal: object) -> str:
tenant_id = str(getattr(principal, "tenant_id", "") or "").strip()
if not tenant_id:
+1 -1
View File
@@ -83,7 +83,7 @@ from govoplan_reporting.backend.search_source import create_reporting_search_sou
MODULE_ID = "reporting"
MODULE_NAME = "Reporting"
MODULE_VERSION = "0.1.21"
MODULE_VERSION = "0.1.22"
def _permission(scope: str, label: str, description: str) -> PermissionDefinition: