api: fix uv manager acquisition if uv is only available in spring

This commit is contained in:
Antoine Bartuccio 2019-10-21 02:10:09 +02:00
parent 86bc491df4
commit f533c39e67
Signed by: klmp200
GPG Key ID: E7245548C53F904B

View File

@ -105,7 +105,10 @@ def make_clean_uv(short_uv, full_uv):
res["hours_{}".format(activity["code"])] += activity["nbh"] // 60 res["hours_{}".format(activity["code"])] += activity["nbh"] // 60
# wrong if the manager changes depending on the semester # wrong if the manager changes depending on the semester
res["manager"] = full_uv["automne"]["responsable"] semester = full_uv.get("automne", None)
if not semester:
semester = full_uv.get("printemps", {})
res["manager"] = semester.get("responsable", "")
res["title"] = full_uv["libelle"] res["title"] = full_uv["libelle"]