Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
fc6a6e3c
Commit
fc6a6e3c
authored
6 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opentech/apply/funds/models/submissions.py
+3
-1
3 additions, 1 deletion
opentech/apply/funds/models/submissions.py
opentech/apply/funds/workflow.py
+8
-7
8 additions, 7 deletions
opentech/apply/funds/workflow.py
with
11 additions
and
8 deletions
opentech/apply/funds/models/submissions.py
+
3
−
1
View file @
fc6a6e3c
...
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/funds/workflow.py
+
8
−
7
View file @
fc6a6e3c
...
...
@@ -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
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment