# HG changeset patch # User Brian Neal # Date 1451165296 21600 # Node ID 2f36abf65a6287ec13fd081a2d33c682a7392f27 # Parent 217084b6e0a037a995902a4ec66130171512541c Fix UnicodeEncodeError issue in custom search form. diff -r 217084b6e0a0 -r 2f36abf65a62 custom_search/forms.py --- a/custom_search/forms.py Sat Dec 26 15:16:10 2015 -0600 +++ b/custom_search/forms.py Sat Dec 26 15:28:16 2015 -0600 @@ -97,18 +97,18 @@ # auto-escaped for us. # # Gather regular search terms - terms = ' '.join(self.cleaned_data['q'].split()) + terms = u' '.join(self.cleaned_data['q'].split()) # Exact words or phrases: exact = self.cleaned_data['exact'].strip() if exact: - exact = '"{}"'.format(exact) + exact = u'"{}"'.format(exact) # Exclude terms: - exclude = ["-{}".format(term) for term in self.cleaned_data['exclude'].split()] - exclude = ' '.join(exclude) + exclude = [u"-{}".format(term) for term in self.cleaned_data['exclude'].split()] + exclude = u' '.join(exclude) - query = ' '.join([terms, exact, exclude]).strip() + query = u' '.join([terms, exact, exclude]).strip() logger.debug("auto_query: %s", query) sqs = self.searchqueryset.auto_query(query)