From 2010cf26710b78d20fa01056bccc74cda7fe2fef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Jun 2011 21:54:23 -0600 Subject: [PATCH] ... --- src/calibre/library/coloring.py | 2 +- src/calibre/library/database2.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py index 80e748473a..db13da9532 100644 --- a/src/calibre/library/coloring.py +++ b/src/calibre/library/coloring.py @@ -185,5 +185,5 @@ def migrate_old_rule(fm, template): r.add_condition('tags', 'has', value) rules.append(r.template) return rules - return template + return [template] diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index b3c584534e..c78f13d698 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -229,8 +229,9 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): if col and templ: try: del self.prefs['column_color_name_'+str(i)] - templ = migrate_old_rule(self.field_metadata, templ) - old_rules.append((col, templ)) + rules = migrate_old_rule(self.field_metadata, templ) + for templ in rules: + old_rules.append((col, templ)) except: pass if old_rules: