mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
forum and core: fix error 500 when query is empty on search
This commit is contained in:
@ -71,6 +71,8 @@ def notification(request, notif_id):
|
||||
|
||||
|
||||
def search_user(query, as_json=False):
|
||||
if query == "":
|
||||
return []
|
||||
res = SearchQuerySet().models(User).autocomplete(auto=query)[:20]
|
||||
return [r.object for r in res]
|
||||
|
||||
|
Reference in New Issue
Block a user