From 85bce24e307c33a6930a96e8e0ca26736735c616 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 15 Jan 2021 12:32:27 +1100 Subject: [PATCH] Limit matches to the 5 "most matchy" ones --- InvenTree/part/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 26cf93e56d..6367921fbf 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -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()