[hamster-applet] don't assume that there is somebody when changing category
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] don't assume that there is somebody when changing category
- Date: Tue, 13 Apr 2010 15:59:15 +0000 (UTC)
commit 08ed23fed7310cca7fc1510b32e83fb3cd96fcec
Author: Toms Bauģis <toms baugis gmail com>
Date: Tue Apr 13 16:58:48 2010 +0100
don't assume that there is somebody when changing category
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 349dea2..cd57d5e 100644
--- a/src/hamster/db.py
+++ b/src/hamster/db.py
@@ -185,7 +185,7 @@ 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
+ if existing_activity and id == existing_activity['id']: # we are already there, go home
return False
if existing_activity: #ooh, we have something here!
@@ -778,7 +778,7 @@ class Storage(storage.Storage):
else:
query = """
- SELECT a.*, b.name as category
+ SELECT a.id, a.name, a.activity_order, a.category_id, b.name as category
FROM activities a
LEFT JOIN categories b on coalesce(b.id, -1) = a.category_id
WHERE deleted IS NULL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]