mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 03:24:04 +00:00
21 lines
494 B
Elixir
21 lines
494 B
Elixir
defmodule Mix.Tasks.FixApUsers do
|
|
use Mix.Task
|
|
import Mix.Ecto
|
|
import Ecto.Query
|
|
alias Pleroma.{Repo, User}
|
|
|
|
@shortdoc "Grab all ap users again"
|
|
def run([]) do
|
|
Mix.Task.run("app.start")
|
|
|
|
q = from u in User,
|
|
where: fragment("? @> ?", u.info, ^%{"ap_enabled" => true})
|
|
users = Repo.all(q)
|
|
|
|
Enum.each(users, fn(user) ->
|
|
IO.puts("Fetching #{user.nickname}")
|
|
Pleroma.Web.ActivityPub.Transmogrifier.upgrade_user_from_ap_id(user.ap_id)
|
|
end)
|
|
end
|
|
end
|