core: fix error getting stages when enrollment flow isn't set

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-16 22:45:42 +02:00
parent 426686957d
commit 79044368d2
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ class SourceFlowManager:
# pylint: disable=unused-argument
def get_stages_to_append(self, flow: Flow) -> list[Stage]:
"""Hook to override stages which are appended to the flow"""
if not self.source.enrollment_flow:
return []
if flow.slug == self.source.enrollment_flow.slug:
return [
in_memory_stage(PostUserEnrollmentStage),