On Thu, Apr 3, 2008 at 8:46 AM, shabda <[EMAIL PROTECTED]> wrote:

> I have TransactionMiddleware in my settings.py, to tie transactions to
> HttpRequests. I also have a custom mIddleware which has a
> processException, it catches the Exceptions and returns user friendly
> responses for the exceptions.
> This means that TransactionMiddleware thinks that exception was not
> raised, and the changes are commited. Is there some thing I can do so
> that TransactionMiddleware can rollback the changes and then my
> Middleware catch the exception and return user friendly responses?
>

Change the ordering of your middleware in settings.py so that
TransactionMiddleware runs before your custom middleware.  Since you're
dealing with the response path, where middleware is applied in the reverse
order of the list, that means place your custom middleware before
TransactionMiddleware in the list.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to