# HG changeset patch # User Brian Neal # Date 1379467609 18000 # Node ID 820e57e621e8631c7f2160819980f734b41f43be # Parent 6ba401391cd5c29ce0383bf3c2dec95abda11f1c 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. diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/bio/userprofile_text.txt --- 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 %} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/downloads/download_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/forums/post_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/forums/topic_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/news/story_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/podcast/item_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/weblinks/link_text.txt --- 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 }} diff -r 6ba401391cd5 -r 820e57e621e8 sg101/templates/search/indexes/ygroup/post_text.txt --- 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 }}