* fix search.py After the PR #17828 in some cases an "IndexError: list assignment index out of range" error is thrown. This should fix it. * Update search.py Yes, that should be even better * style: formatting [skip ci]
This commit is contained in:
parent
7bbd36345a
commit
58cef6005a
1 changed files with 2 additions and 1 deletions
|
|
@ -284,7 +284,8 @@ def build_for_autosuggest(res: list[tuple], doctype: str) -> list[dict]:
|
|||
item = list(item)
|
||||
label = item[1] # use title as label
|
||||
item[1] = item[0] # show name in description instead of title
|
||||
del item[2] # remove redundant title ("label") value
|
||||
if len(item) >= 3:
|
||||
del item[2] # remove redundant title ("label") value
|
||||
results.append({"value": item[0], "label": label, "description": to_string(item[1:])})
|
||||
else:
|
||||
results.extend({"value": item[0], "description": to_string(item[1:])} for item in res)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue