diff --git a/cps/helper.py b/cps/helper.py index d7cb3a90..52e96b6c 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -280,7 +280,7 @@ def get_valid_filename(value, replace_whitespace=True): value = unicode(re_slugify.sub('', value).strip()) if replace_whitespace: #*+:\"/<>? are replaced by _ - value = re.sub('[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U) + value = re.sub(r'[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U) value = value[:128] if not value: diff --git a/cps/static/js/edit_books.js b/cps/static/js/edit_books.js index 3932e3b6..96fcc848 100644 --- a/cps/static/js/edit_books.js +++ b/cps/static/js/edit_books.js @@ -46,8 +46,7 @@ function prefixedSource(prefix, query, cb, bhAdapter) { function getPath() { var jsFileLocation = $("script[src*=edit_books]").attr("src"); // the js file path - jsFileLocation = jsFileLocation.replace("/static/js/edit_books.js", ""); // the js folder path - return jsFileLocation; + return jsFileLocation.substr(0,jsFileLocation.search("/static/js/edit_books.js")); // the js folder path } var authors = new Bloodhound({