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

View file

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