user: search: use get_or_fetch() instead of get_or_fetch_by_nickname()
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 19:58:24 +0000 (19:58 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 14 Feb 2019 20:00:04 +0000 (20:00 +0000)
get_or_fetch() handles the nickname verses URI differences transparently.

lib/pleroma/user.ex

index 3232cb8421e50f7596c778b1482f0b92c70f2f36..29d2b3d896d20a64e78907df1e847889bbd17651 100644 (file)
@@ -731,7 +731,7 @@ defmodule Pleroma.User do
     # Strip the beginning @ off if there is a query
     query = String.trim_leading(query, "@")
 
-    if resolve, do: User.get_or_fetch_by_nickname(query)
+    if resolve, do: get_or_fetch(query)
 
     fts_results = do_search(fts_search_subquery(query), for_user)