diff --git a/authentik/stages/invitation/stage.py b/authentik/stages/invitation/stage.py index d916ac68a..3fc13cc16 100644 --- a/authentik/stages/invitation/stage.py +++ b/authentik/stages/invitation/stage.py @@ -3,6 +3,7 @@ from typing import Optional from deepmerge import always_merger from django.http import HttpRequest, HttpResponse +from django.utils.translation import gettext_lazy as _ from authentik.flows.stage import StageView from authentik.flows.views.executor import SESSION_KEY_GET @@ -44,7 +45,7 @@ class InvitationStageView(StageView): if not invite: self.logger.debug("invalid invitation", token=token) return None - if invite.flow and invite.flow.pk != self.executor.plan.flow_pk: + if invite.flow and invite.flow.pk.hex != self.executor.plan.flow_pk: self.logger.debug("invite for incorrect flow", expected=invite.flow.slug) return None return invite @@ -57,7 +58,7 @@ class InvitationStageView(StageView): if not invite: if stage.continue_flow_without_invitation: return self.executor.stage_ok() - return self.executor.stage_invalid() + return self.executor.stage_invalid(_("Invalid invite/invite not found")) self.executor.plan.context[INVITATION_IN_EFFECT] = True self.executor.plan.context[INVITATION] = invite diff --git a/website/developer-docs/blueprints/v1/tags.md b/website/developer-docs/blueprints/v1/tags.md index da9ec3386..f47c189d4 100644 --- a/website/developer-docs/blueprints/v1/tags.md +++ b/website/developer-docs/blueprints/v1/tags.md @@ -77,7 +77,7 @@ attributes: !If [ Conditionally add YAML to a blueprint. -Similar to a one-line if, the first argument is the condition, which can be any valid yaml or custom tag. It will be evaluted as boolean in python. However, keep in mind that dictionaries and lists will always evaluate to `true`, unless they are empty. +Similar to a one-line if, the first argument is the condition, which can be any valid yaml or custom tag. It will be evaluated as boolean in python. However, keep in mind that dictionaries and lists will always evaluate to `true`, unless they are empty. The second argument is used when the condition is `true`, and the third - when `false`. The YAML inside both arguments will be fully resolved, thus it is possible to use custom YAML tags and even nest them inside dictionaries and lists.