From a6a91471ba628f436a9dea486ed2616eed7d156f Mon Sep 17 00:00:00 2001
From: markus
Date: Fri, 6 Nov 2020 14:51:14 +0100
Subject: [PATCH] pre-process minutes
---
cara/apps/calculator/report_generator.py | 12 ++++++------
cara/apps/calculator/templates/report.html.j2 | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/cara/apps/calculator/report_generator.py b/cara/apps/calculator/report_generator.py
index 1147897c..22f84977 100644
--- a/cara/apps/calculator/report_generator.py
+++ b/cara/apps/calculator/report_generator.py
@@ -104,16 +104,16 @@ def build_report(model: models.Model, form: FormData):
'total_people': form.total_people,
'infected_people': form.infected_people,
'activity_type': form.activity_type,
- 'activity_start': form.activity_start,
- 'activity_finish': form.activity_finish,
- 'infected_start': 826,
- 'infected_finish': 827,
+ 'activity_start': minutes_to_string(form.activity_start),
+ 'activity_finish': minutes_to_string(form.activity_finish),
+ 'infected_start': minutes_to_string(826),
+ 'infected_finish': minutes_to_string(827),
'event_type': form.event_type,
'single_event_date': form.single_event_date,
'recurrent_event_month': form.recurrent_event_month,
'lunch_option': form.lunch_option,
- 'lunch_start': form.lunch_start,
- 'lunch_finish': form.lunch_finish,
+ 'lunch_start': minutes_to_string(form.lunch_start),
+ 'lunch_finish': minutes_to_string(form.lunch_finish),
'coffee_breaks': form.coffee_breaks,
'coffee_duration': form.coffee_duration,
'coffee_times': [['00:00','00:00'], ['00:00','00:00'], ['00:00','00:00'], ['00:00','00:00']],
diff --git a/cara/apps/calculator/templates/report.html.j2 b/cara/apps/calculator/templates/report.html.j2
index f44578d3..8c29bb1b 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: {{ form.minutes_to_string(lunch_start) }}    End: {{ form.minutes_to_string(lunch_finish) }}
+ - Start: {{ lunch_start }}    End: {{ lunch_finish }}
{% else%}
No