web/views/basecontrollers.py
changeset 8695 358d8bed9626
parent 8609 112a04c0473d
child 8748 f5027f8d2478
--- a/web/views/basecontrollers.py	Thu Feb 14 15:39:23 2013 +0100
+++ b/web/views/basecontrollers.py	Thu Feb 14 15:38:25 2013 +0100
@@ -212,14 +212,14 @@
         return (False, {None: req._('not authorized')}, None)
     try:
         ctrl.publish(None)
-    except ValidationError, ex:
+    except ValidationError as ex:
         return (False, _validation_error(req, ex), ctrl._edited_entity)
-    except Redirect, ex:
+    except Redirect as ex:
         try:
             txuuid = req.cnx.commit() # ValidationError may be raised on commit
-        except ValidationError, ex:
+        except ValidationError as ex:
             return (False, _validation_error(req, ex), ctrl._edited_entity)
-        except Exception, ex:
+        except Exception as ex:
             req.cnx.rollback()
             req.exception('unexpected error while validating form')
             return (False, str(ex).decode('utf-8'), ctrl._edited_entity)
@@ -231,7 +231,7 @@
             if ctrl._edited_entity:
                 ctrl._edited_entity.complete()
             return (True, ex.location, ctrl._edited_entity)
-    except Exception, ex:
+    except Exception as ex:
         req.cnx.rollback()
         req.exception('unexpected error while validating form')
         return (False, str(ex).decode('utf-8'), ctrl._edited_entity)
@@ -298,7 +298,7 @@
         txuuid = self._cw.form['txuuid']
         try:
             self._cw.cnx.undo_transaction(txuuid)
-        except UndoTransactionException, exc:
+        except UndoTransactionException as exc:
             errors = exc.errors
             #This will cause a rollback in main_publish
             raise ValidationError(None, {None: '\n'.join(errors)})