diff --git a/functions/search_forms.py b/functions/search_forms.py index f54491b9..f65fc334 100644 --- a/functions/search_forms.py +++ b/functions/search_forms.py @@ -171,7 +171,9 @@ class AbstactSearchForm(forms.Form): if not self.is_valid(): return EmptySearchQuerySet() q = self.cleaned_data.get('q') + q = q.strip() w = self.cleaned_data.get('w') + w = w.strip() fr = self.cleaned_data.get('fr') to = self.cleaned_data.get('to') th = self.cleaned_data.get('th') diff --git a/functions/search_mixin.py b/functions/search_mixin.py index 0e4bcd59..2030f408 100644 --- a/functions/search_mixin.py +++ b/functions/search_mixin.py @@ -10,11 +10,11 @@ class ExpoSearchMixin(object): if obj.country: country = [tr.name for tr in obj.country.translations.all()] else: - country = '' + country = [] if obj.city: city = [tr.name for tr in obj.city.translations.all()] else: - city = '' + city = [] return country + city