[FIX] web: format set_profiling output nicely
JSON content can be rendered nicely by browsers when using the appropriate mimetype closes odoo/odoo#107708 X-original-commit: 70153bbe233bb81d51752c5f1ed1766414eb875b Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
This commit is contained in:
@@ -16,9 +16,9 @@ class Profiling(Controller):
|
||||
profile = profile and profile != '0'
|
||||
try:
|
||||
state = request.env['ir.profile'].set_profiling(profile, collectors=collectors, params=params)
|
||||
return json.dumps(state)
|
||||
return Response(json.dumps(state), mimetype='application/json')
|
||||
except UserError as e:
|
||||
return Response(response='error: %s' % e, status=500)
|
||||
return Response(response='error: %s' % e, status=500, mimetype='text/plain')
|
||||
|
||||
@route(['/web/speedscope', '/web/speedscope/<model("ir.profile"):profile>'], type='http', sitemap=False, auth='user')
|
||||
def speedscope(self, profile=None):
|
||||
|
||||
Reference in New Issue
Block a user