From 015d82ae2b1d26c4276eea9edeeeef48195fb0d2 Mon Sep 17 00:00:00 2001 From: Jack Darlington Date: Fri, 3 Mar 2017 00:03:46 +0000 Subject: [PATCH] Revert "Merging ignorable columns" This reverts commit 8745d65ff6bcc8d81302e803ad19345c1abf7bc9. --- cps/templates/config_edit.html | 5 +---- cps/ub.py | 9 +-------- cps/web.py | 13 +------------ 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index 1a80dfc1..9d107cb2 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -62,10 +62,7 @@ -
- - -
+
diff --git a/cps/ub.py b/cps/ub.py index d9672b5e..aa064282 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -275,7 +275,6 @@ class Settings(Base): config_google_drive_folder = Column(String) config_google_drive_calibre_url_base = Column(String) config_google_drive_watch_changes_response = Column(String) - config_columns_to_ignore = Column(String) def __repr__(self): pass @@ -311,7 +310,7 @@ class Config: self.config_google_drive_watch_changes_response = json.loads(data.config_google_drive_watch_changes_response) else: self.config_google_drive_watch_changes_response=None - self.config_columns_to_ignore = data.config_columns_to_ignore + if (self.config_calibre_dir is not None and not self.config_use_google_drive) or os.path.exists(self.config_calibre_dir + '/metadata.db'): self.db_configured = True else: @@ -407,12 +406,6 @@ def migrate_Database(): conn.execute("ALTER TABLE Settings ADD column `config_google_drive_calibre_url_base` INTEGER DEFAULT 0") conn.execute("ALTER TABLE Settings ADD column `config_google_drive_folder` String DEFAULT ''") conn.execute("ALTER TABLE Settings ADD column `config_google_drive_watch_changes_response` String DEFAULT ''") - try: - session.query(exists().where(Settings.config_columns_to_ignore)).scalar() - except exc.OperationalError: - conn = engine.connect() - conn.execute("ALTER TABLE Settings ADD column `config_columns_to_ignore` String DEFAULT ''") - session.commit() try: session.query(exists().where(Settings.config_default_role)).scalar() session.commit() diff --git a/cps/web.py b/cps/web.py index c4045ba1..f15fe904 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1124,16 +1124,7 @@ def show_book(id): except: entries.languages[index].language_name = _( isoLanguages.get(part3=entries.languages[index].lang_code).name) - tmpcc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() - - if config.config_columns_to_ignore: - cc=[] - for col in tmpcc: - r= re.compile(config.config_columns_to_ignore) - if r.match(col.label): - c.append(col) - else: - cc=tmpcc + cc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() book_in_shelfs = [] shelfs = ub.session.query(ub.BookShelf).filter(ub.BookShelf.book_id == id).all() for entry in shelfs: @@ -1988,8 +1979,6 @@ def configuration_helper(origin): reboot_required = True if "config_calibre_web_title" in to_save: content.config_calibre_web_title = to_save["config_calibre_web_title"] - if "config_columns_to_ignore" in to_save: - content.config_columns_to_ignore = to_save["config_columns_to_ignore"] if "config_title_regex" in to_save: if content.config_title_regex != to_save["config_title_regex"]: content.config_title_regex = to_save["config_title_regex"]