Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

remove duplicate STOP_WORDS compliation #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions basic/blog/feeds.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.contrib.syndication.feeds import FeedDoesNotExist
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.sites.models import Site
from django.contrib.syndication.feeds import Feed
from django.contrib.contenttypes.models import ContentType
from django.contrib.comments.models import Comment
from django.core.urlresolvers import reverse
Expand Down
3 changes: 1 addition & 2 deletions basic/blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ def search(request, template_name='blog/post_search.html'):
"""
context = {}
if request.GET:
stop_word_list = re.compile(STOP_WORDS_RE, re.IGNORECASE)
search_term = '%s' % request.GET['q']
cleaned_search_term = stop_word_list.sub('', search_term)
cleaned_search_term = STOP_WORDS_RE.sub('', search_term)
cleaned_search_term = cleaned_search_term.strip()
if len(cleaned_search_term) != 0:
post_list = Post.objects.published().filter(Q(title__icontains=cleaned_search_term) | Q(body__icontains=cleaned_search_term) | Q(tags__icontains=cleaned_search_term) | Q(categories__title__icontains=cleaned_search_term))
Expand Down