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

add basic logging to the demo

parent 3bfce8bc
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
<h4>There are no actions</h4> <h4>There are no actions</h4>
{% endfor %} {% endfor %}
</form> </form>
<ul>
{% for log in logs %}
<li>{{ log }}</li>
{% endfor %}
</ul>
</section> </section>
<section class="container"> <section class="container">
<a class="button" href="">Reset</a> <a class="button" href="">Reset</a>
......
...@@ -7,6 +7,7 @@ from .workflow import SingleStage, DoubleStage ...@@ -7,6 +7,7 @@ from .workflow import SingleStage, DoubleStage
workflows = [SingleStage, DoubleStage] workflows = [SingleStage, DoubleStage]
logs = []
def demo_workflow(request, wf_id): def demo_workflow(request, wf_id):
wf = int(wf_id) wf = int(wf_id)
...@@ -15,13 +16,19 @@ def demo_workflow(request, wf_id): ...@@ -15,13 +16,19 @@ def demo_workflow(request, wf_id):
current_phase = request.POST.get('current') current_phase = request.POST.get('current')
if request.POST: if request.POST:
current = workflow.current(current_phase)
phase = workflow.process(current_phase, request.POST['action']) phase = workflow.process(current_phase, request.POST['action'])
logs.append(
f'{current.stage}: {current.name} was updated to {phase.stage}: {phase.name}'
)
else: else:
phase = workflow.current(current_phase) phase = workflow.current(current_phase)
logs.clear()
context = { context = {
'workflow': workflow, 'workflow': workflow,
'phase': phase, 'phase': phase,
'logs': logs,
} }
return TemplateResponse(request, 'apply/demo_workflow.html', context) return TemplateResponse(request, 'apply/demo_workflow.html', context)
......
...@@ -224,8 +224,7 @@ class ConceptStage(Stage): ...@@ -224,8 +224,7 @@ class ConceptStage(Stage):
phases = [ phases = [
DeterminationWithNextPhase(), DeterminationWithNextPhase(),
ReviewPhase(), ReviewPhase(),
DeterminationPhase(), DeterminationWithProgressionPhase(),
accepted,
rejected, rejected,
] ]
......
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