[FIX] problem with werkzeug 0.9.1 that makes the code crash when we generate a report