[hamster-applet] return None if no changes are made in add_fact



commit c4845fb4d35a80312b552f5a5e24bf80667635fb
Author: Toms Bauģis <toms baugis gmail com>
Date:   Thu Aug 19 12:47:22 2010 +0100

    return None if no changes are made in add_fact

 src/hamster/db.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/hamster/db.py b/src/hamster/db.py
index 81311b3..14d0079 100644
--- a/src/hamster/db.py
+++ b/src/hamster/db.py
@@ -540,7 +540,7 @@ class Storage(storage.Storage):
 
 
         if not start_time or not activity.activity_name:  # sanity check
-            return 0
+            return None
 
         # now check if maybe there is also a category
         category_id = None
@@ -574,7 +574,7 @@ class Storage(storage.Storage):
                 if previous["activity_id"] == activity_id \
                    and previous["tags"] == sorted([tag["name"] for tag in tags]) \
                    and (previous["description"] or "") == (description or ""):
-                    return previous["id"]
+                    return None
 
                 # otherwise, if no description is added
                 # see if maybe it is too short to qualify as an activity



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]