Commit b3574dcc authored by Ivan Tashkinov's avatar Ivan Tashkinov
Browse files

[#483] User.get_by_nickname/1: allowed retrieving user by fully-qualified local nickname

parent 67b4297f
......@@ -387,7 +387,11 @@ def get_cached_by_nickname(nickname) do
def get_by_nickname(nickname) do
Repo.get_by(User, nickname: nickname)
Repo.get_by(User, nickname: nickname) ||
if String.ends_with?(nickname, "@" <> do
[local_nickname, _] = String.split(nickname, "@")
Repo.get_by(User, nickname: local_nickname)
def get_by_nickname_or_email(nickname_or_email) do
Supports Markdown
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