[FIX] website_forum: set return content-type

The request being of type http, the returned Content-Type was
text/html while the select2 request exepected json in the dataType
This commit is contained in:
Martin Trigaux
2021-12-20 13:55:00 +01:00
parent 4107d17b01
commit cfb9967d37
+4 -1
View File
@@ -185,7 +185,10 @@ class WebsiteForum(WebsiteProfile):
fields=['id', 'name'],
limit=int(limit),
)
return json.dumps(data)
return request.make_response(
json.dumps(data),
headers=[("Content-Type", "application/json")]
)
@http.route(['/forum/<model("forum.forum"):forum>/tag', '/forum/<model("forum.forum"):forum>/tag/<string:tag_char>'], type='http', auth="public", website=True, sitemap=False)
def tags(self, forum, tag_char=None, **post):