Commit a90d38e6063d426c80f0035423f4465c8f4ecac1

Authored by Felipe Henrique de Almeida Bormann
1 parent 11ee4b47

fixed bug on search resources and terms

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
subjects/views.py
@@ -562,7 +562,8 @@ class SubjectSearchView(LoginRequiredMixin, LogMixin, ListView): @@ -562,7 +562,8 @@ class SubjectSearchView(LoginRequiredMixin, LogMixin, ListView):
562 tags = tags.split(" ") 562 tags = tags.split(" ")
563 q = Q() 563 q = Q()
564 for tag in tags: 564 for tag in tags:
565 - q = q | Q(tags__name__unaccent__icontains=tag ) 565 + for word in tag.split(' '):
  566 + q = q | Q(tags__name__unaccent__iexact=word )
566 567
567 subjects = Subject.objects.filter(q).distinct() 568 subjects = Subject.objects.filter(q).distinct()
568 self.resources = Resource.objects.filter(q).distinct() 569 self.resources = Resource.objects.filter(q).distinct()