I just noticed something that may be a bug (in Piston or indeed Django), or may be intentional.
If PISTON_DISPLAY_ERRORS is set to True and an exception is raised in a handler, then Piston will return an HttpResponseServerError. If you're using Django's TransactionMiddleware, then this will prevent the transaction being rolled back; rollback is handled in the middleware's process_exception() method.
Is this by design? It feels to me like Django's transaction middleware should look for 5xx responses and roll back the transaction, as well as rolling back in process_exception().
Obviously, I can create my own transaction middleware with the above behaviour for my own, but was interested in what others' thoughts were on this - and particularly on whether this is a bug, and if so, whether it's in Piston or Django?
Dan Fairs <d...@fezconsulting.com> | http://www.fezconsulting.com/