[Checkins] SVN: Products.CMFCore/trunk/Products/CMFCore/exportimport/cookieauth.py Make the cookie import robust against cookie_authentication not being present

Wichert Akkerman wichert at wiggy.net
Sun Dec 23 17:38:20 EST 2007


Log message for revision 82413:
  Make the cookie import robust against cookie_authentication not being present

Changed:
  U   Products.CMFCore/trunk/Products/CMFCore/exportimport/cookieauth.py

-=-
Modified: Products.CMFCore/trunk/Products/CMFCore/exportimport/cookieauth.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/exportimport/cookieauth.py	2007-12-23 17:04:17 UTC (rev 82412)
+++ Products.CMFCore/trunk/Products/CMFCore/exportimport/cookieauth.py	2007-12-23 22:38:20 UTC (rev 82413)
@@ -62,7 +62,11 @@
     """Import cookie crumbler settings from an XML file.
     """
     site = context.getSite()
-    tool = getToolByName(site, 'cookie_authentication')
+    tool = getToolByName(site, 'cookie_authentication', None)
+    if tool is not None:
+        logger = context.getLogger('cookies')
+        logger.debug('Nothing cookie tool to import.')
+        return
 
     importObjects(tool, '', context)
 



More information about the Checkins mailing list