summaryrefslogtreecommitdiff
path: root/addons/web_editor/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/controllers/main.py')
-rw-r--r--addons/web_editor/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py
index 5a7ca5483f7..603509480f0 100644
--- a/addons/web_editor/controllers/main.py
+++ b/addons/web_editor/controllers/main.py
@@ -158,7 +158,7 @@ class Web_Editor(http.Controller):
def add_data(self, name, data, quality=0, width=0, height=0, res_id=False, res_model='ir.ui.view', filters=False, **kwargs):
try:
data = tools.image_process(data, size=(width, height), quality=quality, verify_resolution=True)
- except OSError:
+ except UserError:
pass # not an image
attachment = self._attachment_create(name=name, data=data, res_id=res_id, res_model=res_model, filters=filters)
return attachment._get_media_info()
@@ -179,7 +179,7 @@ class Web_Editor(http.Controller):
data['name'] = name
try:
data['datas'] = tools.image_process(attachment.datas, size=(width, height), quality=quality)
- except OSError:
+ except UserError:
pass # not an image
attachment.write(data)
return attachment._get_media_info()