diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-26 10:42:36 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-26 10:42:36 +0300 |
commit | c8d3c3bfeca66d16846f97b50328e0718cfe5fef (patch) | |
tree | cfe7074c79f6117443632af5f13fd33672f90732 /lib/mix | |
parent | cad9b325e567c9c607c2b1d33c915cc88da716b1 (diff) | |
parent | dc9090810dbed74da91f2e94f23e5512d259e4fc (diff) | |
download | pleroma-c8d3c3bfeca66d16846f97b50328e0718cfe5fef.tar.gz |
Merge remote-tracking branch 'remotes/upstream/develop' into 1335-user-api-id-fields-relations
# Conflicts:
# lib/pleroma/web/activity_pub/activity_pub.ex
Diffstat (limited to 'lib/mix')
-rw-r--r-- | lib/mix/pleroma.ex | 5 | ||||
-rw-r--r-- | lib/mix/tasks/pleroma/user.ex | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex index faeb30e1d..73a076a53 100644 --- a/lib/mix/pleroma.ex +++ b/lib/mix/pleroma.ex @@ -6,6 +6,11 @@ defmodule Mix.Pleroma do @doc "Common functions to be reused in mix tasks" def start_pleroma do Application.put_env(:phoenix, :serve_endpoints, false, persistent: true) + + if Pleroma.Config.get(:env) != :test do + Application.put_env(:logger, :console, level: :debug) + end + {:ok, _} = Application.ensure_all_started(:pleroma) end diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index 4e3b80db3..bc8eacda8 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -364,6 +364,24 @@ defmodule Mix.Tasks.Pleroma.User do end end + def run(["list"]) do + start_pleroma() + + Pleroma.User.Query.build(%{local: true}) + |> Pleroma.RepoStreamer.chunk_stream(500) + |> Stream.each(fn users -> + users + |> Enum.each(fn user -> + shell_info( + "#{user.nickname} moderator: #{user.info.is_moderator}, admin: #{user.info.is_admin}, locked: #{ + user.info.locked + }, deactivated: #{user.info.deactivated}" + ) + end) + end) + |> Stream.run() + end + defp set_moderator(user, value) do {:ok, user} = user |