2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-16 22:38:28 +00:00

Merge pull request #1233 from SchrodingersGat/limit-matches

Limit matches to the 5 "most matchy" ones
This commit is contained in:
Oliver
2021-01-15 12:55:39 +11:00
committed by GitHub
+3 -1
View File
@@ -655,7 +655,9 @@ class PartCreate(AjaxCreateView):
matches = match_part_names(name)
if len(matches) > 0:
context['matches'] = matches
# Limit to the top 5 matches (to prevent clutter)
context['matches'] = matches[:5]
# Enforce display of the checkbox
form.fields['confirm_creation'].widget = CheckboxInput()