[CMF-checkins] CVS: CMF/CMFCore - CachingPolicyManager.py:1.8.10.1

Tres Seaver tseaver at zope.com
Wed Mar 31 23:10:04 EST 2004


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv26521/CMFCore

Modified Files:
      Tag: CMF-1_4-branch
	CachingPolicyManager.py 
Log Message:
 - Apply patch from Collector #234.


=== CMF/CMFCore/CachingPolicyManager.py 1.8 => 1.8.10.1 ===
--- CMF/CMFCore/CachingPolicyManager.py:1.8	Thu Feb 13 03:28:42 2003
+++ CMF/CMFCore/CachingPolicyManager.py	Wed Mar 31 23:10:03 2004
@@ -266,7 +266,7 @@
                  , no_cache         # boolean (def. 0)
                  , no_store         # boolean (def. 0)
                  , must_revalidate  # boolean (def. 0)
-                 , REQUEST
+                 , REQUEST=None
                  ):
         """
             Add a caching policy.
@@ -279,10 +279,12 @@
                        , no_store
                        , must_revalidate
                        )
-        REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
-                              + '/manage_cachingPolicies'
-                              + '?manage_tabs_message=Policy+added.'
-                              )
+        if REQUEST is not None: 
+            REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
+                                          + '/manage_cachingPolicies'
+                                          + '?manage_tabs_message='
+                                          + 'Policy+added.'
+                                          )
 
     security.declareProtected( ManagePortal, 'updatePolicy' )
     def updatePolicy( self
@@ -293,7 +295,8 @@
                     , no_cache          # boolean (def. 0)
                     , no_store          # boolean (def. 0)
                     , must_revalidate   # boolean (def. 0)
-                    , REQUEST ):
+                    , REQUEST=None
+                    ):
         """
             Update a caching policy.
         """
@@ -305,13 +308,15 @@
                           , no_store
                           , must_revalidate
                           )
-        REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
-                              + '/manage_cachingPolicies'
-                              + '?manage_tabs_message=Policy+updated.'
-                              )
+        if REQUEST is not None: 
+            REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
+                                          + '/manage_cachingPolicies'
+                                          + '?manage_tabs_message='
+                                          + 'Policy+updated.'
+                                          )
 
     security.declareProtected( ManagePortal, 'movePolicyUp' )
-    def movePolicyUp( self, policy_id, REQUEST ):
+    def movePolicyUp( self, policy_id, REQUEST=None ):
         """
             Move a caching policy up in the list.
         """
@@ -322,13 +327,14 @@
         else:
             self._reorderPolicy( predicate_id, ndx - 1 )
             msg = "Policy+moved."
-        REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
+        if REQUEST is not None:
+            REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
                               + '/manage_cachingPolicies'
                               + '?manage_tabs_message=%s' % msg
                               )
 
     security.declareProtected( ManagePortal, 'movePolicyDown' )
-    def movePolicyDown( self, policy_id, REQUEST ):
+    def movePolicyDown( self, policy_id, REQUEST=None ):
         """
             Move a caching policy down in the list.
         """
@@ -339,18 +345,20 @@
         else:
             self._reorderPolicy( policy_id, ndx + 1 )
             msg = "Policy+moved."
-        REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
+        if REQUEST is not None:
+            REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
                               + '/manage_cachingPolicies'
                               + '?manage_tabs_message=%s' % msg
                               )
 
     security.declareProtected( ManagePortal, 'removePolicy' )
-    def removePolicy( self, policy_id, REQUEST ):
+    def removePolicy( self, policy_id, REQUEST=None ):
         """
             Remove a caching policy.
         """
         self._removePolicy( policy_id )
-        REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
+        if REQUEST is not None:
+            REQUEST[ 'RESPONSE' ].redirect( self.absolute_url()
                               + '/manage_cachingPolicies'
                               + '?manage_tabs_message=Policy+removed.'
                               )




More information about the CMF-checkins mailing list