Make sure arg for Actors.get_actor_by_name/2 doesn't start with @

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-04-09 12:12:06 +02:00
parent bbfe3de471
commit 4079af6f72
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
1 changed files with 1 additions and 1 deletions

View File

@ -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