Skip to content

Commit

Permalink
Merge pull request #611 from Ravie403/fix/notFoundValueOnSearch
Browse files Browse the repository at this point in the history
Fix named_entries error
  • Loading branch information
hinashi authored Sep 9, 2022
2 parents 3eacb2a + bcd12e0 commit 7e153af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions airone/lib/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,8 +899,6 @@ def make_search_results(
}

elif attrinfo["type"] == AttrTypeValue["named_object"]:
if attrinfo["key"] == attrinfo["value"] == attrinfo["referral_id"] == "":
continue
ret_attrinfo["value"] = {
attrinfo["key"]: {
"id": attrinfo["referral_id"],
Expand Down
2 changes: 1 addition & 1 deletion entry/tests/test_api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ def test_import_update_entry(self):
"vals": [],
"ref": {"id": "", "name": ""},
"refs": [],
# "name": None,
"name": {"": {"id": "", "name": ""}},
"names": [],
"group": {"id": "", "name": ""},
"groups": [],
Expand Down
6 changes: 5 additions & 1 deletion entry/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4176,7 +4176,11 @@ def test_get_es_document_without_attribute_value(self):
"type": AttrTypeValue["group"],
"value": {"id": "", "name": ""},
},
"name": {"is_readble": True, "type": AttrTypeValue["named_object"]},
"name": {
"is_readble": True,
"type": AttrTypeValue["named_object"],
"value": {"": {"id": "", "name": ""}},
},
"obj": {
"is_readble": True,
"type": AttrTypeValue["object"],
Expand Down
2 changes: 1 addition & 1 deletion templates/advanced_search/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function make_attr_elem(attr, hint_attr) {

return `<div class='row'> \
<div class='col'> \
<p class='url_conv'>${ key }</p> \
<p class='url_conv'>${ key ?? '' }</p> \
</div> \
<div class='col'>${ value_str }</div> \
</div>`;
Expand Down

0 comments on commit 7e153af

Please sign in to comment.