Fix company name encoding in UI
Change-Id: I0fda3f207b172303afc4426f954b85ebad4bfdae
This commit is contained in:
@@ -89,7 +89,8 @@ class CachedMemoryStorage(MemoryStorage):
|
|||||||
|
|
||||||
if have_updates:
|
if have_updates:
|
||||||
self.company_name_mapping = dict(
|
self.company_name_mapping = dict(
|
||||||
(c.lower(), c) for c in self.company_index.keys())
|
(c.lower().replace('&', ''), c)
|
||||||
|
for c in self.company_index.keys())
|
||||||
|
|
||||||
return have_updates
|
return have_updates
|
||||||
|
|
||||||
|
@@ -288,7 +288,7 @@ function makeURI(uri, options) {
|
|||||||
$.extend(ops, options);
|
$.extend(ops, options);
|
||||||
}
|
}
|
||||||
var str = $.map(ops,function (val, index) {
|
var str = $.map(ops,function (val, index) {
|
||||||
return index + "=" + encodeURI(val).toLowerCase();
|
return index + "=" + encodeURI(val.replace("&", "")).toLowerCase();
|
||||||
}).join("&");
|
}).join("&");
|
||||||
|
|
||||||
return (str == "") ? uri : uri + "?" + str;
|
return (str == "") ? uri : uri + "?" + str;
|
||||||
@@ -329,7 +329,7 @@ function initSingleSelector(name, api_url, select2_extra_options, change_handler
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
var initial_value = getUrlVars()[name];
|
var initial_value = getUrlVars()[name];
|
||||||
if (initial_value) {
|
if (initial_value) {
|
||||||
initial_value = encodeURI(initial_value).toLocaleLowerCase();
|
initial_value = (initial_value).toLocaleLowerCase();
|
||||||
} else if (data["default"]) {
|
} else if (data["default"]) {
|
||||||
initial_value = data["default"];
|
initial_value = data["default"];
|
||||||
}
|
}
|
||||||
|
@@ -272,7 +272,7 @@ def get_contribution_json(records, **kwargs):
|
|||||||
@decorators.record_filter(ignore=['company'])
|
@decorators.record_filter(ignore=['company'])
|
||||||
def get_companies_json(record_ids, **kwargs):
|
def get_companies_json(record_ids, **kwargs):
|
||||||
memory_storage = vault.get_memory_storage()
|
memory_storage = vault.get_memory_storage()
|
||||||
companies = set(memory_storage.get_original_company_name(company)
|
companies = set(company
|
||||||
for company in memory_storage.get_index_keys_by_record_ids(
|
for company in memory_storage.get_index_keys_by_record_ids(
|
||||||
'company_name', record_ids))
|
'company_name', record_ids))
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ def get_companies_json(record_ids, **kwargs):
|
|||||||
companies.add(memory_storage.get_original_company_name(
|
companies.add(memory_storage.get_original_company_name(
|
||||||
kwargs['_params']['company'][0]))
|
kwargs['_params']['company'][0]))
|
||||||
|
|
||||||
return [{'id': utils.safe_encode(c.lower()), 'text': c}
|
return [{'id': c.lower().replace('&', ''), 'text': c}
|
||||||
for c in sorted(companies)]
|
for c in sorted(companies)]
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user