Handle errors=None in _finalize_traitement

Sometimes the `errors` variable is `None` in `_finalize_traitement`.
It was not an issue when it was just used in the templates but now we
have to handle this in the view. Basically, we shall consider it is an
empty list when it occurs.
This commit is contained in:
Martin Pépin 2017-03-15 11:59:41 +00:00
parent c37754376b
commit 98abe71681

View file

@ -102,8 +102,9 @@ def _finalize_traitement(request, demande, proposals, proposed_for,
'style="width:99%; height: 90px;">'
'</textarea>'
})
for error in errors:
messages.error(request, error)
if errors is not None:
for error in errors:
messages.error(request, error)
return render(request, "gestioncof/traitement_demande_petit_cours.html",
{"demande": demande,
"unsatisfied": unsatisfied,