Commit 8a9f0898 authored by rinpatch's avatar rinpatch

remove id cast

parent 5a08dee3
......@@ -462,19 +462,7 @@ def get_cached_by_nickname(nickname) 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment