Commit b8d45b66 authored by OzzieIsaacs's avatar OzzieIsaacs

Typeahead working again

Fix for replacing characters in filenames
parent ad161947
......@@ -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:
......
......@@ -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({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment