From e97d8e7132d7545d9c293e259968f2da8e0e549d Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Sat, 30 Jan 2016 10:54:29 +0100
Subject: [PATCH] Correction:  __iexact by __icontains in searches

---
 commentaries/views.py | 12 ++++++------
 submissions/views.py  |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/commentaries/views.py b/commentaries/views.py
index 4caa6e822..0660ee1a9 100644
--- a/commentaries/views.py
+++ b/commentaries/views.py
@@ -116,9 +116,9 @@ def commentaries(request):
         form = CommentarySearchForm(request.POST)
         if form.is_valid() and form.has_changed():
             commentary_search_list = Commentary.objects.filter(
-                pub_title__iexact=form.cleaned_data['pub_title_keyword'],
-                author_list__iexact=form.cleaned_data['pub_author'],
-                pub_abstract__iexact=form.cleaned_data['pub_abstract_keyword'],
+                pub_title__icontains=form.cleaned_data['pub_title_keyword'],
+                author_list__icontains=form.cleaned_data['pub_author'],
+                pub_abstract__icontains=form.cleaned_data['pub_abstract_keyword'],
                 vetted=True,
                 )
             commentary_search_list.order_by('-pub_date')
@@ -139,9 +139,9 @@ def browse(request, discipline, nrweeksback):
         form = CommentarySearchForm(request.POST)
         if form.is_valid() and form.has_changed():
             commentary_search_list = Commentary.objects.filter(
-                pub_title__iexact=form.cleaned_data['pub_title_keyword'],
-                author_list__iexact=form.cleaned_data['pub_author'],
-                pub_abstract__iexact=form.cleaned_data['pub_abstract_keyword'],
+                pub_title__icontains=form.cleaned_data['pub_title_keyword'],
+                author_list__icontains=form.cleaned_data['pub_author'],
+                pub_abstract__icontains=form.cleaned_data['pub_abstract_keyword'],
                 vetted=True,
                 )
             commentary_search_list.order_by('-pub_date')
diff --git a/submissions/views.py b/submissions/views.py
index edc759c95..b3eaebbfb 100644
--- a/submissions/views.py
+++ b/submissions/views.py
@@ -90,9 +90,9 @@ def submissions(request):
         form = SubmissionSearchForm(request.POST)
         if form.is_valid() and form.has_changed():
             submission_search_list = Submission.objects.filter(
-                title__iexact=form.cleaned_data['title_keyword'],
-                author_list__iexact=form.cleaned_data['author'],
-                abstract__iexact=form.cleaned_data['abstract_keyword'],
+                title__icontains=form.cleaned_data['title_keyword'],
+                author_list__icontains=form.cleaned_data['author'],
+                abstract__icontains=form.cleaned_data['abstract_keyword'],
                 status__gte=1,
                 )
             submission_search_list.order_by('-pub_date')
-- 
GitLab