From 4013abe4de1d3cff06d28fc3aa334016fa550d50 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 19 Jul 2021 01:26:26 +0200 Subject: [PATCH] style fix --- InvenTree/InvenTree/views.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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({})