From 8a9f089812295ef5087864e852ad9550ee00ce76 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 16 Jan 2019 17:58:11 +0300 Subject: [PATCH] remove id cast --- lib/pleroma/user.ex | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) 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 -- 2.45.2