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
e09fbdf4
Commit
e09fbdf4
authored
7 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Fix the flake8 errors
parent
01400db9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
opentech/apply/tests/test_workflow.py
+1
-0
1 addition, 0 deletions
opentech/apply/tests/test_workflow.py
opentech/apply/views.py
+1
-4
1 addition, 4 deletions
opentech/apply/views.py
opentech/apply/workflow.py
+4
-4
4 additions, 4 deletions
opentech/apply/workflow.py
with
6 additions
and
8 deletions
opentech/apply/tests/test_workflow.py
+
1
−
0
View file @
e09fbdf4
...
@@ -9,6 +9,7 @@ from .factories import ActionFactory, PhaseFactory, StageFactory, WorkflowFactor
...
@@ -9,6 +9,7 @@ from .factories import ActionFactory, PhaseFactory, StageFactory, WorkflowFactor
class
TestWorkflowCreation
(
SimpleTestCase
):
class
TestWorkflowCreation
(
SimpleTestCase
):
def
test_can_create_workflow
(
self
):
def
test_can_create_workflow
(
self
):
stage
=
StageFactory
()
stage
=
StageFactory
()
class
NewWorkflow
(
Workflow
):
class
NewWorkflow
(
Workflow
):
name
=
'
single_stage
'
name
=
'
single_stage
'
stage_classes
=
[
stage
]
stage_classes
=
[
stage
]
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/views.py
+
1
−
4
View file @
e09fbdf4
from
django
import
forms
from
django
import
forms
from
django.shortcuts
import
render
from
django.template.response
import
TemplateResponse
from
django.template.response
import
TemplateResponse
from
.workflow
import
SingleStage
,
DoubleStage
from
.workflow
import
SingleStage
,
DoubleStage
...
@@ -18,7 +17,7 @@ class BasicSubmissionForm(forms.Form):
...
@@ -18,7 +17,7 @@ class BasicSubmissionForm(forms.Form):
def
demo_workflow
(
request
,
wf_id
):
def
demo_workflow
(
request
,
wf_id
):
wf
=
int
(
wf_id
)
wf
=
int
(
wf_id
)
workflow_class
=
workflows
[
wf
-
1
]
workflow_class
=
workflows
[
wf
-
1
]
workflow
=
workflow_class
([
BasicSubmissionForm
]
*
wf
)
workflow
=
workflow_class
([
BasicSubmissionForm
]
*
wf
)
current_phase
=
request
.
POST
.
get
(
'
current
'
)
current_phase
=
request
.
POST
.
get
(
'
current
'
)
...
@@ -59,5 +58,3 @@ def demo_workflow(request, wf_id):
...
@@ -59,5 +58,3 @@ def demo_workflow(request, wf_id):
'
form
'
:
form
,
'
form
'
:
form
,
}
}
return
TemplateResponse
(
request
,
'
apply/demo_workflow.html
'
,
context
)
return
TemplateResponse
(
request
,
'
apply/demo_workflow.html
'
,
context
)
This diff is collapsed.
Click to expand it.
opentech/apply/workflow.py
+
4
−
4
View file @
e09fbdf4
...
@@ -45,7 +45,7 @@ class Workflow:
...
@@ -45,7 +45,7 @@ class Workflow:
for
i
,
stage
in
enumerate
(
self
.
stages
):
for
i
,
stage
in
enumerate
(
self
.
stages
):
if
stage
==
current_stage
:
if
stage
==
current_stage
:
try
:
try
:
return
self
.
stages
[
i
+
1
]
return
self
.
stages
[
i
+
1
]
except
IndexError
:
except
IndexError
:
pass
pass
...
@@ -69,7 +69,6 @@ class Workflow:
...
@@ -69,7 +69,6 @@ class Workflow:
return
stage
.
next
()
return
stage
.
next
()
return
None
return
None
def
__str__
(
self
)
->
str
:
def
__str__
(
self
)
->
str
:
return
self
.
name
return
self
.
name
...
@@ -112,17 +111,18 @@ class Stage:
...
@@ -112,17 +111,18 @@ class Stage:
for
i
,
phase
in
enumerate
(
self
.
phases
):
for
i
,
phase
in
enumerate
(
self
.
phases
):
if
phase
==
current_phase
:
if
phase
==
current_phase
:
try
:
try
:
return
self
.
phases
[
i
+
1
]
return
self
.
phases
[
i
+
1
]
except
IndexError
:
except
IndexError
:
pass
pass
return
None
return
None
class
Phase
:
class
Phase
:
actions
:
Sequence
[
'
Action
'
]
=
list
()
actions
:
Sequence
[
'
Action
'
]
=
list
()
name
:
str
=
''
name
:
str
=
''
public_name
:
str
=
''
public_name
:
str
=
''
def
__init__
(
self
,
name
:
str
=
''
,
public_name
:
str
=
''
)
->
None
:
def
__init__
(
self
,
name
:
str
=
''
,
public_name
:
str
=
''
)
->
None
:
if
name
:
if
name
:
self
.
name
=
name
self
.
name
=
name
...
...
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