fix(responses): invalidate changed options safely

This commit is contained in:
2026-07-20 18:30:04 +02:00
parent e0de54b756
commit 12b3175b07
3 changed files with 122 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ from govoplan_poll.backend.service import (
create_poll_invitation,
decide_poll,
get_poll,
get_poll_response_for_respondents,
list_poll_responses,
open_poll,
poll_result_summary_by_id,
@@ -291,6 +292,27 @@ class SqlPollSchedulingProvider(PollSchedulingProvider):
raise PollCapabilityError(str(exc)) from exc
return tuple(_response_ref(response) for response in responses)
def get_response(
self,
session: object,
*,
tenant_id: str,
poll_id: str,
respondent_ids: Sequence[str],
invitation_id: str | None = None,
) -> PollResponseRef | None:
try:
response = get_poll_response_for_respondents(
session,
tenant_id=tenant_id,
poll_id=poll_id,
respondent_ids=tuple(respondent_ids),
invitation_id=invitation_id,
)
except PollError as exc:
raise PollCapabilityError(str(exc)) from exc
return _response_ref(response) if response is not None else None
@staticmethod
def _transition(callback, session: object, *, tenant_id: str, poll_id: str) -> PollRef:
try: