mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Limit matches to the 5 "most matchy" ones
This commit is contained in:
		@@ -655,7 +655,9 @@ class PartCreate(AjaxCreateView):
 | 
				
			|||||||
            matches = match_part_names(name)
 | 
					            matches = match_part_names(name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if len(matches) > 0:
 | 
					            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
 | 
					                # Enforce display of the checkbox
 | 
				
			||||||
                form.fields['confirm_creation'].widget = CheckboxInput()
 | 
					                form.fields['confirm_creation'].widget = CheckboxInput()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user