Commit bf06aea6 authored by Théo Labetowiez's avatar Théo Labetowiez

core: fix whitespaces in user and forum search

parent a12edcda
Pipeline #1744 failed with stage
in 1 minute and 36 seconds
......@@ -71,7 +71,7 @@ def notification(request, notif_id):
def search_user(query, as_json=False):
if query == "":
if query == "" or query.isspace():
return []
res = SearchQuerySet().models(User).autocomplete(auto=query)[:20]
return [r.object for r in res]
......
......@@ -56,7 +56,7 @@ class ForumSearchView(ListView):
query = self.request.GET.get("query", "")
order_by = self.request.GET.get("order", "")
if query == "":
if query == "" or query.isspace():
return []
queryset = RelatedSearchQuerySet().models(ForumMessage).autocomplete(auto=query)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment