User search: Once again, change uri handling.

They can indeed be non-unique.
This commit is contained in:
lain 2020-09-30 14:14:41 +02:00
commit 90fee49c52
3 changed files with 17 additions and 2 deletions

View file

@ -54,8 +54,9 @@ defmodule Pleroma.User.Search do
defp maybe_add_uri_match(list, query) do
with {:ok, query} <- UriType.cast(query),
%User{} = user <- Pleroma.Repo.get_by(User, uri: query) do
[user.id | list]
q = from(u in User, where: u.uri == ^query, select: u.id),
users = Pleroma.Repo.all(q) do
users ++ list
else
_ -> list
end