mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +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):
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user