import Ecto.Query
def feed_redirect(conn, %{"nickname" => nickname}) do
- with %User{} = user <- User.get_cached_by_nickname(nickname) do
- case get_format(conn) do
- "html" -> Fallback.RedirectController.redirector(conn, nil)
- _ -> redirect conn, external: OStatus.feed_path(user)
- end
- else
- _e -> send_resp(conn, 404, "No user found")
+ user = User.get_cached_by_nickname(nickname)
+
+ case get_format(conn) do
+ "html" -> Fallback.RedirectController.redirector(conn, nil)
+ _ -> redirect conn, external: OStatus.feed_path(user)
end
end