Skip to content

Commit 3ad6d69

Browse files
committed
[FIX] website: avoid using werkzeug API only present in 0.9+
bzr revid: [email protected]
1 parent c16780d commit 3ad6d69

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

addons/website/controllers/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,15 @@ def website_image(self, model, id, field, max_width=maxint, max_height=maxint):
393393
# record provides a pre-resized version of the base field, use that
394394
# directly
395395
if record.get(presized):
396-
response.set_data(data)
396+
response.data = data
397397
return response
398398

399399
fit = int(max_width), int(max_height)
400400
w, h = image.size
401401
max_w, max_h = fit
402402

403403
if w < max_w and h < max_h:
404-
response.set_data(data)
404+
response.data = data
405405
else:
406406
image.thumbnail(fit, Image.ANTIALIAS)
407407
image.save(response.stream, image.format)

addons/website/models/ir_http.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _serve_attachment(self):
121121
return response
122122

123123
response.mimetype = attach[0]['mimetype']
124-
response.set_data(datas.decode('base64'))
124+
response.data = datas.decode('base64')
125125
return response
126126

127127
def _handle_exception(self, exception=None, code=500):

0 commit comments

Comments
 (0)