This commit is contained in:
Egor 2019-02-20 16:51:25 +00:00 committed by kaniini
commit bff9eb5ef7
18 changed files with 347 additions and 5 deletions

View file

@ -273,7 +273,7 @@ defmodule Pleroma.User do
Pleroma.Config.get([:instance, :account_activation_required]) do
user
|> Pleroma.UserEmail.account_confirmation_email()
|> Pleroma.Mailer.deliver()
|> Pleroma.Mailer.deliver_async()
else
{:ok, :noop}
end
@ -1284,4 +1284,13 @@ defmodule Pleroma.User do
inserted_at: NaiveDateTime.utc_now()
}
end
def all_superusers do
from(
u in User,
where: u.local == true,
where: fragment("?->'is_admin' @> 'true' OR ?->'is_moderator' @> 'true'", u.info, u.info)
)
|> Repo.all()
end
end