Author: batiste.bieler
Date: Tue May  5 08:30:20 2009
New Revision: 508

Modified:
    branches/electron/pages/utils.py

Log:
Exclude the localmiddleware from the get_request_mock

Modified: branches/electron/pages/utils.py
==============================================================================
--- branches/electron/pages/utils.py    (original)
+++ branches/electron/pages/utils.py    Tue May  5 08:30:20 2009
@@ -20,12 +20,13 @@
          'SERVER_NAME': 'test',
          'SERVER_PORT': '8000',
      })
-    if language_code:
-        request.COOKIES[django_settings.LANGUAGE_COOKIE_NAME] =  
language_code

      # Apply request middleware
      for middleware_method in bh._request_middleware:
-        response = middleware_method(request)
+        # LocaleMiddleware should never be applied a second time because
+        # it would broke the current real request
+        if 'LocaleMiddleware' not in str(middleware_method.im_class):
+            response = middleware_method(request)
      return request

  def get_placeholders(template_name, language_code=None):

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

Reply via email to