[Zope-Checkins] CVS: Zope/lib/python/OFS - DTMLMethod.py:1.67.2.1

Matthew T. Kromer matt@zope.com
Mon, 1 Oct 2001 17:08:26 -0400


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv27775/OFS

Modified Files:
      Tag: Zope-2_4-branch
	DTMLMethod.py 
Log Message:
Add minor DTML accelerator, DTMLValidate is the same as the normal
SecurityManger's validate except it can be called by DTML without having to
remap the arguments.  Discovered as a minor performance improvement for
a media client in NYC.


=== Zope/lib/python/OFS/DTMLMethod.py 1.67 => 1.67.2.1 ===
         security=getSecurityManager()
         security.addContext(self)
+        self.validate = security.DTMLValidate
         try:
         
             if client is None:
@@ -197,7 +198,9 @@
                     self.ZCacheable_set(r)
                 return r
 
-        finally: security.removeContext(self)
+        finally:
+            security.removeContext(self)
+            del self.validate
 
         have_key=RESPONSE.headers.has_key
         if not (have_key('content-type') or have_key('Content-Type')):