2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-10 23:14:13 +00:00

Simplify display of possible conflicting parts

- Round to single digit
- Only show 5 closest matches
This commit is contained in:
Oliver Walters
2020-10-28 23:48:35 +11:00
parent 091a9d9803
commit ed8be5225d
4 changed files with 18 additions and 10 deletions

View File

@ -245,7 +245,7 @@ def match_part_names(match, threshold=80, reverse=True, compare_length=False):
if ratio >= threshold:
matches.append({
'part': part,
'ratio': ratio
'ratio': round(ratio, 1)
})
matches = sorted(matches, key=lambda item: item['ratio'], reverse=reverse)