[hamster-applet/gnome-2-30] fixed broken logic when moving activity to another category



commit 338b8ba5c1bac4b2d7963a769ce235290d37ae4e
Author: Toms Bauģis <toms baugis gmail com>
Date:   Tue Apr 13 17:02:00 2010 +0100

    fixed broken logic when moving activity to another category

 src/hamster/db.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/db.py b/src/hamster/db.py
index fb01c47..e0dee2e 100644
--- a/src/hamster/db.py
+++ b/src/hamster/db.py
@@ -159,10 +159,10 @@ class Storage(storage.Storage):
         activity = self.fetchone("select name from activities where id = ?", (id, ))
         existing_activity = self.__get_activity_by_name(activity['name'], category_id)
 
-        if id == existing_activity['id']: # we are already there, go home
-            return False
-
         if existing_activity: #ooh, we have something here!
+            if id == existing_activity['id']: # we are already there, go home
+                return False
+
             # first move all facts that belong to movable activity to the new one
             update = """
                        UPDATE facts



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