[Zope3-checkins] CVS: Zope3/src/zope/app/services - view.py:1.17

Guido van Rossum guido@python.org
Wed, 30 Apr 2003 17:57:15 -0400


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv12195

Modified Files:
	view.py 
Log Message:
Fix a rather subtle bug in ViewService.getRegisteredMatching().

The viewName argument was reused as a loop control variable,
overwriting the search key when searching the second and later
layers.  This caused the View service not to show views defined in
other layers than the default (at least in my case).

XXX This is missing a test case; I don't understand the test code well
enough to be able to add one.


=== Zope3/src/zope/app/services/view.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/services/view.py:1.16	Wed Apr 30 13:51:34 2003
+++ Zope3/src/zope/app/services/view.py	Wed Apr 30 17:57:14 2003
@@ -200,8 +200,8 @@
             else:
                 viewNames = (viewName, )
 
-            for viewName in viewNames:
-                registry = names_dict.get(viewName)
+            for vn in viewNames:
+                registry = names_dict.get(vn)
 
                 if registry is None:
                     continue
@@ -210,7 +210,7 @@
                     required_interfaces,
                     presentation_type):
 
-                    result.append(match + (layer, viewName))
+                    result.append(match + (layer, vn))
 
         return result