Resolve public poll invitations to tenant policy
This commit is contained in:
@@ -32,6 +32,7 @@ from govoplan_poll.backend.participation import (
|
||||
PollInvitationRevocationRef,
|
||||
PollOptionMutationRef,
|
||||
PollParticipationContextRef,
|
||||
PollPublicInvitationRef,
|
||||
PollResponseGatewayRef,
|
||||
)
|
||||
from govoplan_poll.backend.participation_service import (
|
||||
@@ -323,6 +324,28 @@ class SqlPollSchedulingProvider(PollSchedulingProvider):
|
||||
except (PollError, ValidationError) as exc:
|
||||
raise PollCapabilityError(str(exc)) from exc
|
||||
|
||||
def resolve_public_invitation(
|
||||
self,
|
||||
session: object,
|
||||
*,
|
||||
token: str,
|
||||
gateway: PollResponseGatewayRef,
|
||||
) -> PollPublicInvitationRef:
|
||||
try:
|
||||
invitation = governed_invitation(
|
||||
session,
|
||||
token=token,
|
||||
gateway=gateway,
|
||||
)
|
||||
except (PollError, ValidationError) as exc:
|
||||
raise PollCapabilityError(str(exc)) from exc
|
||||
return PollPublicInvitationRef(
|
||||
invitation_id=invitation.id,
|
||||
tenant_id=invitation.tenant_id,
|
||||
poll_id=invitation.poll_id,
|
||||
gateway=gateway,
|
||||
)
|
||||
|
||||
def submit_governed_response(
|
||||
self,
|
||||
session: object,
|
||||
|
||||
Reference in New Issue
Block a user