^^^^^^^^^^^^^^^^
Backward Incompatibilities
~~~~~~~~~~~~~~~~~~~~~~~~~~
- This is a backward-incompatible change for anyone using the
``tm.commit_veto`` hook. Anyone else is unaffected.
The ``tm.commit_veto`` hook will now be consulted for any squashed
exceptions instead of always aborting. Previously, if an exception
was handled by an exception view, the transaction would always be aborted.
Now, the ``commit_veto`` can inspect ``request.exception`` and the generated
``response`` to determine whether to commit or abort.
The new behavior when using the ``pyramid_tm.default_commit_veto`` is that
a squashed exception may be committed if either of the following conditions
are true:
- The response contains the ``x-tm`` header set to ``commit``.
- The response's status code does not start with ``4`` or ``5``.
In most cases the response would result in 4xx or 5xx exception and would
be aborted - this behavior remains the same. However, if the squashed
exception rendered a response that is 3xx or 2xx (such as raising
``pyramid.httpexceptions.HTTPFound``), then the transaction will be
committed instead of aborted.
See https://github.com/Pylons/pyramid_tm/pull/65