From dbe44a9c1cf8759212c4b43d632d41253b94ee09 Mon Sep 17 00:00:00 2001 From: tleb Date: Fri, 18 Oct 2019 01:45:49 +0200 Subject: [PATCH] Fix hour count and submit button --- api/views/api.py | 2 +- pedagogy/templates/pedagogy/uv_create.jinja | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/views/api.py b/api/views/api.py index 47967f2b..f70517ce 100644 --- a/api/views/api.py +++ b/api/views/api.py @@ -125,7 +125,7 @@ def uv_endpoint(request): res["hours_{}".format(activity)] = 0 for activity in uv["activites"]: if activity["code"] in activities: - res["hours_{}".format(activity["code"])] += activity["nbh"] + res["hours_{}".format(activity["code"])] += activity["nbh"] // 60 res["manager"] = uv["automne"]["responsable"] diff --git a/pedagogy/templates/pedagogy/uv_create.jinja b/pedagogy/templates/pedagogy/uv_create.jinja index a14d43bc..a648799b 100644 --- a/pedagogy/templates/pedagogy/uv_create.jinja +++ b/pedagogy/templates/pedagogy/uv_create.jinja @@ -12,7 +12,11 @@ {% for field in form %} - {% if not field.is_hidden %} + {% if field.is_hidden %} + + {{ field }} + + {% else %}

{{ field.errors }}