From f63e1973c69c4410312bf09762e5892775068d01 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 3 Mar 2011 18:06:08 +0000 Subject: [PATCH] Fix not detecting reuse of a column key --- src/calibre/gui2/preferences/create_custom_column.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/preferences/create_custom_column.py b/src/calibre/gui2/preferences/create_custom_column.py index 922717477b..07e91804a2 100644 --- a/src/calibre/gui2/preferences/create_custom_column.py +++ b/src/calibre/gui2/preferences/create_custom_column.py @@ -181,10 +181,12 @@ class CreateCustomColumn(QDialog, Ui_QCreateCustomColumn): is_multiple = False if not col_heading: return self.simple_error('', _('No column heading was provided')) + bad_col = False - if col in self.parent.custcols: + colkey = '#' + col + if colkey in self.parent.custcols: if not self.editing_col or \ - self.parent.custcols[col]['colnum'] != self.orig_column_number: + self.parent.custcols[colkey]['colnum'] != self.orig_column_number: bad_col = True if bad_col: return self.simple_error('', _('The lookup name %s is already used')%col)