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
6a984ffa
Commit
6a984ffa
authored
7 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Use the internal name to get the string
parent
20738a62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentech/apply/workflow.py
+4
-2
4 additions, 2 deletions
opentech/apply/workflow.py
with
4 additions
and
2 deletions
opentech/apply/workflow.py
+
4
−
2
View file @
6a984ffa
...
@@ -3,6 +3,7 @@ import copy
...
@@ -3,6 +3,7 @@ import copy
from
typing
import
Dict
,
Iterator
,
Iterable
,
List
,
Sequence
,
Tuple
,
Union
from
typing
import
Dict
,
Iterator
,
Iterable
,
List
,
Sequence
,
Tuple
,
Union
from
django.forms
import
Form
from
django.forms
import
Form
from
django.utils.text
import
slugify
class
Workflow
:
class
Workflow
:
...
@@ -89,7 +90,7 @@ class Stage:
...
@@ -89,7 +90,7 @@ class Stage:
def
current
(
self
,
phase_name
:
str
,
occurance
:
str
)
->
'
Phase
'
:
def
current
(
self
,
phase_name
:
str
,
occurance
:
str
)
->
'
Phase
'
:
for
phase
in
self
.
phases
:
for
phase
in
self
.
phases
:
if
phase
.
name
==
phase_name
and
int
(
occurance
)
==
phase
.
occurance
:
if
phase
.
_internal
==
phase_name
and
int
(
occurance
)
==
phase
.
occurance
:
return
phase
return
phase
return
None
return
None
...
@@ -115,6 +116,7 @@ class Phase:
...
@@ -115,6 +116,7 @@ class Phase:
def
__init__
(
self
,
name
:
str
=
''
)
->
None
:
def
__init__
(
self
,
name
:
str
=
''
)
->
None
:
if
name
:
if
name
:
self
.
name
=
name
self
.
name
=
name
self
.
_internal
=
slugify
(
self
.
name
)
self
.
stage
:
Union
[
'
Stage
'
,
None
]
=
None
self
.
stage
:
Union
[
'
Stage
'
,
None
]
=
None
self
.
_actions
=
{
action
.
name
:
action
for
action
in
self
.
actions
}
self
.
_actions
=
{
action
.
name
:
action
for
action
in
self
.
actions
}
self
.
occurance
:
int
=
0
self
.
occurance
:
int
=
0
...
@@ -128,7 +130,7 @@ class Phase:
...
@@ -128,7 +130,7 @@ class Phase:
return
list
(
self
.
_actions
.
keys
())
return
list
(
self
.
_actions
.
keys
())
def
__str__
(
self
)
->
str
:
def
__str__
(
self
)
->
str
:
return
'
__
'
.
join
([
self
.
stage
.
name
,
self
.
name
,
str
(
self
.
occurance
)])
return
'
__
'
.
join
([
self
.
stage
.
name
,
self
.
_internal
,
str
(
self
.
occurance
)])
def
__getitem__
(
self
,
value
:
str
)
->
'
Action
'
:
def
__getitem__
(
self
,
value
:
str
)
->
'
Action
'
:
return
self
.
_actions
[
value
]
return
self
.
_actions
[
value
]
...
...
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