Code

better fix
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 26 Mar 2004 23:56:11 +0000 (23:56 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Fri, 26 Mar 2004 23:56:11 +0000 (23:56 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2219 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/backends/sessions_dbm.py

index 82782d005f04b91991d38bf76ce84944c7cfefb7..33d204f322d25b1f9df923113e41b0763968d485 100644 (file)
@@ -1,4 +1,4 @@
-#$Id: sessions_dbm.py,v 1.3 2004-03-26 23:54:40 richard Exp $
+#$Id: sessions_dbm.py,v 1.4 2004-03-26 23:56:11 richard Exp $
 """This module defines a very basic store that's used by the CGI interface
 to store session and one-time-key information.
 
@@ -131,8 +131,11 @@ class BasicDatabase:
         """
         week = 60*60*24*7
         for sessid in self.list():
-            interval = now - self.get(sessid, '__timestamp',
-                default=time.time())
+            sess = self.get(sessid, '__timestamp', None)
+            if sess is None:
+                sess=time.time()
+                self.updateTimestamp(sessid)
+            interval = now - sess
             if interval > week:
                 self.destroy(sessid)