Re: [Django] #14588: Changed behaviour of middlewares after [14393]

2010-10-29 Thread Django
#14588: Changed behaviour of middlewares after [14393]
+---
  Reporter:  Petr Marhoun   | Owner:  
nobody
Status:  new| Milestone:

 Component:  Core framework |   Version:  
SVN   
Resolution: |  Keywords:

 Stage:  Accepted   | Has_patch:  0 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * stage:  Unreviewed => Accepted

Comment:

 Yes, this is a change in behavior that wasn't picked up by our test suite.
 I've got a fix in progress, along with a bunch of tests to validate the
 intended behavior of the request/response cycle.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #14588: Changed behaviour of middlewares after [14393]

2010-10-29 Thread Django
#14588: Changed behaviour of middlewares after [14393]
+---
  Reporter:  Petr Marhoun   | Owner:  
nobody
Status:  new| Milestone:

 Component:  Core framework |   Version:  
SVN   
Resolution: |  Keywords:

 Stage:  Unreviewed | Has_patch:  0 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Changes (by kmike):

 * cc: kmike (added)
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



[Django] #14588: Changed behaviour of middlewares after [14393]

2010-10-29 Thread Django
#14588: Changed behaviour of middlewares after [14393]
---+
 Reporter:  Petr Marhoun   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Core framework | Version:  SVN   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Documentation says:

 Unlike the process_request() and process_view() methods, the
 process_response() method is always called, even if the process_request()
 and process_view() methods of the same middleware class were skipped
 because an earlier middleware method returned an HttpResponse.

 But after [14393] response middleware are called only if there is no
 response from process_request or process_view or process_exception or
 Http404 or PermissionDenied.

 It is problematic with transaction middleware - it is necessary to call
 process_response or process_exception to close open transaction. But if
 process_response returns response, transaction is still opened and
 stacked. And if there is something outside transaction in the following
 request in the same thread, it is not committed - for example session
 middleware could be outside, it would be impossible to login.

 I also found one bug in my code - if process_exception returns response,
 following exception middlewares are skipped and transaction could be
 closed in ThreadMiddleware.process_response. So there was commit, not
 rollback (before [14393]). It was logical consequence of the
 documentation, but maybe there could be a note about it.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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