[Zope-Checkins] CVS: Zope/lib/python/Products/Sessions - SessionDataManager.py:1.20

Chris McDonough chrism@zope.com
Fri, 19 Jul 2002 00:44:35 -0400


Update of /cvs-repository/Zope/lib/python/Products/Sessions
In directory cvs.zope.org:/tmp/cvs-serv21038

Modified Files:
	SessionDataManager.py 
Log Message:
Fixed bug in SessionDataManager's "hasSessionData" method in which
a call to it would create a session data object -- the hasSessionData
call now does not create a session data object inadvertently as a result
of its usage.

Also updated tests.


=== Zope/lib/python/Products/Sessions/SessionDataManager.py 1.19 => 1.20 ===
     security.declareProtected(ACCESS_SESSIONDATA_PERM, 'hasSessionData')
     def hasSessionData(self):
         """ """
-        return not not self.getSessionData(create=0)
+        key = self.getBrowserIdManager().getBrowserId(create=0)
+        if key is None:
+            return 0
+        return self._hasSessionDataObject(key)
 
     security.declareProtected(ARBITRARY_SESSIONDATA_PERM,'getSessionDataByKey')
     def getSessionDataByKey(self, key):