Skip to content
Snippets Groups Projects
Commit a6b98f81 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Provide a fallback for stages if the ordering changes

parent 047445d3
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,12 @@ class Workflow(Iterable):
if phase:
return phase
stage_name, _, _ = current_phase.split('__')
for stage in self.stages:
if stage.name == stage_name:
# Fall back to the first phase of the stage
return stage.first()
return None
def first(self) -> 'Phase':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment