[Zope-Checkins] SVN: Zope/branches/regebro-traversalfix/lib/python/ZPublisher/ When using default view name, make sure it really is a view.

Lennart Regebro cvs-admin at zope.org
Sun Jun 18 14:04:37 EDT 2006


Log message for revision 68736:
  When using default view name, make sure it really is a view.
  

Changed:
  U   Zope/branches/regebro-traversalfix/lib/python/ZPublisher/BaseRequest.py
  U   Zope/branches/regebro-traversalfix/lib/python/ZPublisher/tests/testBaseRequest.py

-=-
Modified: Zope/branches/regebro-traversalfix/lib/python/ZPublisher/BaseRequest.py
===================================================================
--- Zope/branches/regebro-traversalfix/lib/python/ZPublisher/BaseRequest.py	2006-06-18 17:56:58 UTC (rev 68735)
+++ Zope/branches/regebro-traversalfix/lib/python/ZPublisher/BaseRequest.py	2006-06-18 18:04:33 UTC (rev 68736)
@@ -147,7 +147,9 @@
         # deprecated. So we handle that here:
         default_name = queryDefaultViewName(self.context, request)
         if default_name is not None:
-            return self.context, (default_name,)
+            # Adding '@@' here forces this to be a view.
+            # A neater solution might be desireable.
+            return self.context, ('@@' + default_name,)
         return self.context, ()
         
 

Modified: Zope/branches/regebro-traversalfix/lib/python/ZPublisher/tests/testBaseRequest.py
===================================================================
--- Zope/branches/regebro-traversalfix/lib/python/ZPublisher/tests/testBaseRequest.py	2006-06-18 17:56:58 UTC (rev 68735)
+++ Zope/branches/regebro-traversalfix/lib/python/ZPublisher/tests/testBaseRequest.py	2006-06-18 18:04:33 UTC (rev 68736)
@@ -151,7 +151,6 @@
         r = self.makeBaseRequest()
         self.f1.objWithBPTH._path = ['view']
         self.f1.objWithBD._default_path = ['view']
-        import pdb;pdb.set_trace()
         r.traverse('folder/objWithBD/objWithBPTH')
         self.assertEqual(r.URL, '/folder/objWithBD/objWithBPTH/view')
         self.assertEqual(r.response.base, '/folder/objWithBD/objWithBPTH/')



More information about the Zope-Checkins mailing list