changeset 715:820e57e621e8

Use |safe filter on Haystack templates to get better results w/quotes. Content was getting escaped, so text with quotes around it was seemingly missing from the search index. This change fixed that. I verified that the search results will not leak raw HTML to the page so this should be safe to do.
author Brian Neal <bgneal@gmail.com>
date Tue, 17 Sep 2013 20:26:49 -0500
parents 6ba401391cd5
children f68694669023
files sg101/templates/search/indexes/bio/userprofile_text.txt sg101/templates/search/indexes/downloads/download_text.txt sg101/templates/search/indexes/forums/post_text.txt sg101/templates/search/indexes/forums/topic_text.txt sg101/templates/search/indexes/news/story_text.txt sg101/templates/search/indexes/podcast/item_text.txt sg101/templates/search/indexes/weblinks/link_text.txt sg101/templates/search/indexes/ygroup/post_text.txt
diffstat 8 files changed, 35 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/sg101/templates/search/indexes/bio/userprofile_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/bio/userprofile_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,11 +1,11 @@
-{{ object.user.username }}
-{{ object.user.get_full_name }}
-{{ object.location }}
-{{ object.occupation }}
-{{ object.interests }}
-{{ object.profile_text }}
-{{ object.signature }}
+{{ object.user.username|safe }}
+{{ object.user.get_full_name|safe }}
+{{ object.location|safe }}
+{{ object.occupation|safe }}
+{{ object.interests|safe }}
+{{ object.profile_text|safe }}
+{{ object.signature|safe }}
 {% for website in object.user.website_profiles.all %}
-{{ website.name }}
+{{ website.name|safe }}
 {{ website.url }}
 {% endfor %}
--- a/sg101/templates/search/indexes/downloads/download_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/downloads/download_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,4 +1,4 @@
-{{ object.title }}
-{{ object.user.username }}
-{{ object.user.get_full_name }}
-{{ object.description }}
+{{ object.title|safe }}
+{{ object.user.username|safe }}
+{{ object.user.get_full_name|safe }}
+{{ object.description|safe }}
--- a/sg101/templates/search/indexes/forums/post_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/forums/post_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,3 +1,3 @@
-{{ object.user.username }}
-{{ object.user.get_full_name }}
-{{ object.body }}
+{{ object.user.username|safe }}
+{{ object.user.get_full_name|safe }}
+{{ object.body|safe }}
--- a/sg101/templates/search/indexes/forums/topic_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/forums/topic_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,3 +1,3 @@
-{{ object.name }}
-{{ object.user.username }}
-{{ object.user.get_full_name }}
+{{ object.name|safe }}
+{{ object.user.username|safe }}
+{{ object.user.get_full_name|safe }}
--- a/sg101/templates/search/indexes/news/story_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/news/story_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,6 +1,6 @@
-{{ object.title }}
-{{ object.submitter.username }}
-{{ object.submitter.get_full_name }}
-{{ object.short_text }}
-{{ object.long_text }}
-{{ object.tags }}
+{{ object.title|safe }}
+{{ object.submitter.username|safe }}
+{{ object.submitter.get_full_name|safe }}
+{{ object.short_text|safe }}
+{{ object.long_text|safe }}
+{{ object.tags|safe }}
--- a/sg101/templates/search/indexes/podcast/item_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/podcast/item_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,5 +1,5 @@
-{{ object.title }}
-{{ object.author }}
-{{ object.subtitle }}
-{{ object.summary }}
-{{ object.keywords }}
+{{ object.title|safe }}
+{{ object.author|safe }}
+{{ object.subtitle|safe }}
+{{ object.summary|safe }}
+{{ object.keywords|safe }}
--- a/sg101/templates/search/indexes/weblinks/link_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/weblinks/link_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,5 +1,5 @@
-{{ object.title }}
+{{ object.title|safe }}
 {{ object.url }}
-{{ object.user.username }}
-{{ object.user.get_full_name }}
-{{ object.description }}
+{{ object.user.username|safe }}
+{{ object.user.get_full_name|safe }}
+{{ object.description|safe }}
--- a/sg101/templates/search/indexes/ygroup/post_text.txt	Tue Sep 17 20:23:23 2013 -0500
+++ b/sg101/templates/search/indexes/ygroup/post_text.txt	Tue Sep 17 20:26:49 2013 -0500
@@ -1,2 +1,2 @@
-{{ object.title }}
-{{ object.msg }}
+{{ object.title|safe }}
+{{ object.msg|safe }}