template: Flask 1.0 compatibility fix

* Fixes return value of Jinja loader iteration due to change in
  Flask 1.0. (closes #2216)

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>