forum and core: fix error 500 when query is empty on search

This commit is contained in:
klmp200 authored and Skia committed 2018-12-13 20:33:34 +01:00
1 parent 65a0b7b2d4
commit 347caa3b6a
3 files changed
+5 -1

No files matched your search

+2
View File
@@ -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]