Add mix task for bulk [un]confirming the local instance users

This commit is contained in:
Mark Felder 2020-09-08 16:39:41 -05:00
commit 75b6fef25d
4 changed files with 105 additions and 13 deletions

View file

@ -2123,6 +2123,13 @@ defmodule Pleroma.User do
Enum.map(users, &toggle_confirmation/1)
end
@spec need_confirmation(User.t(), boolean()) :: {:ok, User.t()} | {:error, Changeset.t()}
def need_confirmation(%User{} = user, bool) do
user
|> confirmation_changeset(need_confirmation: bool)
|> update_and_set_cache()
end
def get_mascot(%{mascot: %{} = mascot}) when not is_nil(mascot) do
mascot
end