From 4079af6f72019575540b4dbc0bd1e7dc1e0c7c9b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 9 Apr 2021 12:12:06 +0200 Subject: [PATCH] Make sure arg for Actors.get_actor_by_name/2 doesn't start with @ Signed-off-by: Thomas Citharel --- lib/mobilizon/actors/actors.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobilizon/actors/actors.ex b/lib/mobilizon/actors/actors.ex index e55f1070..21dc47a8 100644 --- a/lib/mobilizon/actors/actors.ex +++ b/lib/mobilizon/actors/actors.ex @@ -156,7 +156,7 @@ defmodule Mobilizon.Actors do query |> filter_by_type(type) - |> filter_by_name(String.split(name, "@")) + |> filter_by_name(name |> String.trim() |> String.trim_leading("@") |> String.split("@")) |> Repo.one() end