Fixed some things

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-11-07 16:09:28 +01:00
parent 74bc21fa2c
commit 0585b9e6d5
7 changed files with 43 additions and 20 deletions

View File

@@ -275,7 +275,7 @@ defmodule Mobilizon.Actors do
actor =
case String.split(name, "@") do
[name] ->
Repo.get_by(Actor, preferred_username: name)
Repo.one(from(a in Actor, where: a.preferred_username == ^name and is_nil(a.domain)))
[name, domain] ->
Repo.get_by(Actor, preferred_username: name, domain: domain)