summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeif Lotfy <seif@Gary>2010-04-19 15:57:59 +0200
committerSeif Lotfy <seif@Gary>2010-04-19 15:57:59 +0200
commite57bab2e33ec187431b7dd63a166cfeb0d2b456a (patch)
tree9494a5231905582419323b2a6b2cc8095a919ebf
parent6d6ffc3f6eecb917aa07d23db5acbfb32e88ca33 (diff)
parent3838293910d454469344eafb549cd4dd47910ee0 (diff)
merge with kamstrups changes and my optmizations on the associated stuff
-rw-r--r--_zeitgeist/engine/main.py6
-rwxr-xr-xtest/engine-test.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/_zeitgeist/engine/main.py b/_zeitgeist/engine/main.py
index d83e4677..03b49292 100644
--- a/_zeitgeist/engine/main.py
+++ b/_zeitgeist/engine/main.py
@@ -488,8 +488,10 @@ class ZeitgeistEngine:
WHERE id IN (%s)
""" % ",".join(["?"] * len(ids)), ids)
timestamps = self._cursor.fetchone()
-
- if timestamps and all(timestamps):
+
+ # Make sure that we actually found some events with these ids...
+ # We can't do all(timestamps) here because the timestamps may be 0
+ if timestamps and timestamps[0] is not None and timestamps[1] is not None:
# FIXME: Delete unused interpretation/manifestation/text/etc.
self._cursor.execute("DELETE FROM event WHERE id IN (%s)"
% ",".join(["?"] * len(ids)), ids)
diff --git a/test/engine-test.py b/test/engine-test.py
index 224f979c..f13ecb56 100755
--- a/test/engine-test.py
+++ b/test/engine-test.py
@@ -124,6 +124,7 @@ class ZeitgeistEngineTest(_engineTestClass):
self.testSingleInsertGet()
self.engine.delete_events([1])
result = self.engine.get_events([1])
+ print result
self.assertEquals(0, len(filter(None, result)))
def testDeleteSingleCascades(self):