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

Revert some changes so we avoid clash on the Phase keys

parent 9d8bad28
No related branches found
No related tags found
No related merge requests found
......@@ -402,7 +402,9 @@ class ApplicationSubmission(
for phase in STAGE_CHANGE_ACTIONS:
transition = self.get_transition(phase)
if can_proceed(transition):
target = PHASES[phase].stage
# We convert to dict as not concerned about transitions from the first phase
# See note in workflow.py
target = dict(PHASES)[phase].stage
if not target:
raise ValueError('Incorrect State for transition')
......
......@@ -429,7 +429,9 @@ WORKFLOWS = {
}
PHASES = dict(itertools.chain.from_iterable(workflow.items() for workflow in WORKFLOWS.values()))
# This is not a dictionary as the keys will clash for the first phase of each workflow
# We cannot find the transitions for the first stage in this instance
PHASES = list(itertools.chain.from_iterable(workflow.items() for workflow in WORKFLOWS.values()))
def get_stage_change_actions():
......@@ -449,12 +451,11 @@ STAGE_CHANGE_ACTIONS = get_stage_change_actions()
STATUSES = defaultdict(set)
for key, value in PHASES.items():
for key, value in PHASES:
STATUSES[value.display_name].add(key)
active_statuses = [
status for status in PHASES
status for status, _ in PHASES
if 'accepted' not in status and 'rejected' not in status and 'invited' not in status
]
......@@ -462,7 +463,7 @@ active_statuses = [
def get_review_statuses(user=None):
reviews = set()
for phase_name, phase in PHASES.items():
for phase_name, phase in PHASES:
if 'review' in phase_name and 'discussion' not in phase_name:
if user is None:
reviews.add(phase_name)
......@@ -473,7 +474,7 @@ def get_review_statuses(user=None):
review_statuses = get_review_statuses()
DETERMINATION_PHASES = list(phase_name for phase_name in PHASES if '_discussion' in phase_name)
DETERMINATION_PHASES = list(phase_name for phase_name, _ in PHASES if '_discussion' in phase_name)
DETERMINATION_RESPONSE_PHASES = [
'post_review_discussion',
'concept_review_discussion',
......@@ -483,7 +484,7 @@ DETERMINATION_RESPONSE_PHASES = [
def get_determination_transitions():
transitions = {}
for phase_name, phase in PHASES.items():
for phase_name, phase in PHASES:
for transition_name in phase.transitions:
if 'accepted' in transition_name:
transitions[transition_name] = 'accepted'
......
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