[Zope3-checkins] CVS: Zope3/src/zope/app/publication - http.py:1.5

Sidnei da Silva sidnei@x3ng.com.br
Sat, 29 Mar 2003 12:08:08 -0500


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

Modified Files:
	http.py 
Log Message:
Behave differently when found a IHTTPException. We dont want to search the view for request.method, because zopepublisher already found the view for us

=== Zope3/src/zope/app/publication/http.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/publication/http.py:1.4	Tue Feb 11 10:59:52 2003
+++ Zope3/src/zope/app/publication/http.py	Sat Mar 29 12:08:08 2003
@@ -19,11 +19,14 @@
 from zope.app.publication.zopepublication import ZopePublication
 from zope.component import getView
 from zope.publisher.publish import mapply
+from zope.app.interfaces.http import IHTTPException
 
 class HTTPPublication(ZopePublication):
     "HTTP-specific support"
 
     def callObject(self, request, ob):
-        ob = getView(ob, request.method, request)
-        ob = getattr(ob, request.method)
+        # Exception handling, dont try to call request.method
+        if not IHTTPException.isImplementedBy(ob):
+            ob = getView(ob, request.method, request)
+            ob = getattr(ob, request.method)
         return mapply(ob, request.getPositionalArguments(), request)