search: Apply following filter only when user is usable

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-09-02 20:11:24 +02:00 committed by rinpatch
parent 10ef532c63
commit 16c451f8f1

View File

@ -115,8 +115,8 @@ defp trigram_rank(query, query_string) do
)
end
defp base_query(_user, false), do: User
defp base_query(user, true), do: User.get_friends_query(user)
defp base_query(%User{} = user, true), do: User.get_friends_query(user)
defp base_query(_user, _following), do: User
defp filter_invisible_users(query) do
from(q in query, where: q.invisible == false)