[FIX] correctly handle invalid max_width/max_height passed to website._image
authorXavier Morel <xmo@openerp.com>
Fri, 23 May 2014 13:11:13 +0000 (15:11 +0200)
committerXavier Morel <xmo@openerp.com>
Fri, 23 May 2014 13:11:13 +0000 (15:11 +0200)
addons/website/models/website.py

index e0aac6d..9828e9a 100644 (file)
@@ -555,8 +555,10 @@ class website(osv.osv):
         if record.get(presized):
             response.data = data
             return response
-
-        fit = int(max_width), int(max_height)
+        try:
+            fit = int(max_width), int(max_height)
+        except TypeError:
+            fit = (maxint, maxint)
         w, h = image.size
         max_w, max_h = fit