mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
core: fix whitespaces in user and forum search
This commit is contained in:
parent
a12edcda15
commit
bf06aea680
@ -71,7 +71,7 @@ def notification(request, notif_id):
|
|||||||
|
|
||||||
|
|
||||||
def search_user(query, as_json=False):
|
def search_user(query, as_json=False):
|
||||||
if query == "":
|
if query == "" or query.isspace():
|
||||||
return []
|
return []
|
||||||
res = SearchQuerySet().models(User).autocomplete(auto=query)[:20]
|
res = SearchQuerySet().models(User).autocomplete(auto=query)[:20]
|
||||||
return [r.object for r in res]
|
return [r.object for r in res]
|
||||||
|
@ -56,7 +56,7 @@ class ForumSearchView(ListView):
|
|||||||
query = self.request.GET.get("query", "")
|
query = self.request.GET.get("query", "")
|
||||||
order_by = self.request.GET.get("order", "")
|
order_by = self.request.GET.get("order", "")
|
||||||
|
|
||||||
if query == "":
|
if query == "" or query.isspace():
|
||||||
return []
|
return []
|
||||||
|
|
||||||
queryset = RelatedSearchQuerySet().models(ForumMessage).autocomplete(auto=query)
|
queryset = RelatedSearchQuerySet().models(ForumMessage).autocomplete(auto=query)
|
||||||
|
Loading…
Reference in New Issue
Block a user