[hamster-applet] flag to avoid activity ressurection
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] flag to avoid activity ressurection
- Date: Sun, 17 Jan 2010 19:26:39 +0000 (UTC)
commit 1f7a20b2ae33c5a41d8f2be38ccf5fef5c2d18a0
Author: Toms Bauģis <toms baugis gmail com>
Date: Sun Jan 17 19:25:47 2010 +0000
flag to avoid activity ressurection
hamster/db.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/hamster/db.py b/hamster/db.py
index 6fb5f19..09c0000 100644
--- a/hamster/db.py
+++ b/hamster/db.py
@@ -229,7 +229,7 @@ class Storage(storage.Storage):
- def __get_activity_by_name(self, name, category_id = None):
+ def __get_activity_by_name(self, name, category_id = None, ressurect = True):
"""get most recent, preferably not deleted activity by it's name"""
if category_id:
@@ -255,7 +255,9 @@ class Storage(storage.Storage):
if res:
# if the activity was marked as deleted, ressurect on first call
# and put in the unsorted category
- if res['deleted']:
+ if res['deleted'] and not ressurect:
+ return None
+ elif res['deleted']:
update = """
UPDATE activities
SET deleted = null, category_id = -1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]