diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py index fa702a057d..6fbad4383b 100644 --- a/InvenTree/InvenTree/views.py +++ b/InvenTree/InvenTree/views.py @@ -21,7 +21,6 @@ from django.views.generic import ListView, DetailView, CreateView, FormView, Del from django.views.generic.base import RedirectView, TemplateView from djmoney.contrib.exchange.models import ExchangeBackend, Rate -from rest_framework.schemas.coreapi import SchemaGenerator from common.settings import currency_code_default, currency_codes from part.models import Part, PartCategory @@ -773,12 +772,8 @@ class SearchResultView(TemplateView): def get(self, request, *args, **kwargs): query = request.GET.get('term', '') if len(query) > 2: - objects = Part.objects.filter( - Q(name__icontains=query) | - Q(description__icontains=query) | - Q(IPN__icontains=query) | - Q(keywords__icontains=query) | - Q(category__name__icontains=query)).order_by('name') + objects = Part.objects.filter(Q(name__icontains=query) | Q(description__icontains=query) | Q(IPN__icontains=query) + | Q(keywords__icontains=query) | Q(category__name__icontains=query)).order_by('name') return JsonResponse([{'id': a.pk, 'value': a.name} for a in objects[0:5]], safe=False) return JsonResponse({})