From 93207ff8e83636b61ee9931ecd0f3e1b40e50d02 Mon Sep 17 00:00:00 2001
From: markus
Date: Fri, 6 Nov 2020 13:52:04 +0100
Subject: [PATCH] use minutes_to_string in report
---
cara/apps/calculator/report_generator.py | 7 ++++---
cara/apps/calculator/templates/report.html.j2 | 6 +++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py
index a4fc0c36..1bc46b60 100644
--- a/cara/apps/calculator/report_generator.py
+++ b/cara/apps/calculator/report_generator.py
@@ -76,7 +76,8 @@ def build_report(model: models.Model, form: FormData):
context = {
'model': model,
- 'request': request,
+ 'request': request,
+ 'form': form,
'creation_date': time,
'model_version': 'Beta v1.0.0',
'simulation_name': form.simulation_name,
@@ -96,8 +97,8 @@ def build_report(model: models.Model, form: FormData):
'activity_type': form.activity_type,
'activity_start': form.activity_start,
'activity_finish': form.activity_finish,
- 'exposure_start': '00:00',
- 'exposure_finish': '01:15',
+ 'infected_start': 826,
+ 'infected_finish': 827,
'event_type': form.event_type,
'single_event_date': form.single_event_date,
'recurrent_event_month': form.recurrent_event_month,
diff --git a/cara/apps/calculator/templates/report.html.j2 b/cara/apps/calculator/templates/report.html.j2
index 205bbdd9..f44578d3 100644
--- a/cara/apps/calculator/templates/report.html.j2
+++ b/cara/apps/calculator/templates/report.html.j2
@@ -70,11 +70,11 @@
{% endif %}
Exposure time (presence of infected person):
{% if event_type == "single_event"%}
Single event on {{ single_event_date }}
@@ -91,7 +91,7 @@
{% if lunch_option%}
Yes
- - Start: {{ lunch_start }}    End: {{ lunch_finish }}
+ - Start: {{ form.minutes_to_string(lunch_start) }}    End: {{ form.minutes_to_string(lunch_finish) }}
{% else%}
No