From: rinpatch Date: Wed, 16 Jan 2019 14:58:11 +0000 (+0300) Subject: remove id cast X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8a9f089812295ef5087864e852ad9550ee00ce76;p=akkoma remove id cast --- diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 3becd545c..fdc552f75 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -462,19 +462,7 @@ defmodule Pleroma.User do end def get_cached_by_nickname_or_id(nickname_or_id) do - try do - # TODO: convert to UUIDs when !654 is merged - maybe_id = String.to_integer(nickname_or_id) - user = get_cached_by_id(maybe_id) - - if user == nil do - raise ArgumentError, message: "No such user id" - else - user - end - rescue - ArgumentError -> - get_cached_by_nickname(nickname_or_id) + get_cached_by_id(maybe_id) || get_cached_by_nickname(nickname_or_id) end end