From b4aede78bcaee1e95e4b7e524e5a0771b5e907de Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Tue, 28 Nov 2017 08:54:21 +0100 Subject: [PATCH] Fix for the piping problem (#395) --- cps/helper.py | 3 ++- cps/web.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index 52e96b6c..2a85f8fc 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -281,7 +281,8 @@ def get_valid_filename(value, replace_whitespace=True): if replace_whitespace: #*+:\"/<>? are replaced by _ value = re.sub(r'[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U) - + # pipe has to be replaced with comma + value = re.sub(r'[\|]+', u',', value, flags=re.U) value = value[:128] if not value: raise ValueError("Filename cannot be empty") diff --git a/cps/web.py b/cps/web.py index 8f6c9046..61122591 100755 --- a/cps/web.py +++ b/cps/web.py @@ -600,7 +600,7 @@ def modify_database_object(input_elements, db_book_object, db_object, db_session # if no element is found add it if new_element is None: if db_type == 'author': - new_element = db_object(add_element, add_element, "") + new_element = db_object(add_element, add_element.replace('|',','), "") elif db_type == 'series': new_element = db_object(add_element, add_element) elif db_type == 'custom':