Typeahead working again
Fix for replacing characters in filenames
This commit is contained in:
parent
ad16194798
commit
b8d45b664a
|
@ -280,7 +280,7 @@ def get_valid_filename(value, replace_whitespace=True):
|
||||||
value = unicode(re_slugify.sub('', value).strip())
|
value = unicode(re_slugify.sub('', value).strip())
|
||||||
if replace_whitespace:
|
if replace_whitespace:
|
||||||
#*+:\"/<>? are replaced by _
|
#*+:\"/<>? are replaced by _
|
||||||
value = re.sub('[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U)
|
value = re.sub(r'[\*\+:\\\"/<>\?]+', u'_', value, flags=re.U)
|
||||||
|
|
||||||
value = value[:128]
|
value = value[:128]
|
||||||
if not value:
|
if not value:
|
||||||
|
|
|
@ -46,8 +46,7 @@ function prefixedSource(prefix, query, cb, bhAdapter) {
|
||||||
|
|
||||||
function getPath() {
|
function getPath() {
|
||||||
var jsFileLocation = $("script[src*=edit_books]").attr("src"); // the js file path
|
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.substr(0,jsFileLocation.search("/static/js/edit_books.js")); // the js folder path
|
||||||
return jsFileLocation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var authors = new Bloodhound({
|
var authors = new Bloodhound({
|
||||||
|
|
Loading…
Reference in New Issue
Block a user