@moduledoc File.read!("docs/administration/CLI_tasks/user.md")
def run(["new", nickname, email | rest]) do
+ Application.ensure_all_started(:flake_id)
+
{options, [], []} =
OptionParser.parse(
rest,
def run(["rm", nickname]) do
start_pleroma()
+ Application.ensure_all_started(:flake_id)
with %User{local: true} = user <- User.get_cached_by_nickname(nickname),
{:ok, delete_data, _} <- Builder.delete(user, user.ap_id),
with %User{} = user <- User.get_cached_by_nickname(nickname) do
user = user |> User.tag(tags)
- shell_info("Tags of #{user.nickname}: #{inspect(tags)}")
+ shell_info("Tags of #{user.nickname}: #{inspect(user.tags)}")
else
_ ->
shell_error("Could not change user tags for #{nickname}")
with %User{} = user <- User.get_cached_by_nickname(nickname) do
user = user |> User.untag(tags)
- shell_info("Tags of #{user.nickname}: #{inspect(tags)}")
+ shell_info("Tags of #{user.nickname}: #{inspect(user.tags)}")
else
_ ->
shell_error("Could not change user tags for #{nickname}")
def run(["delete_activities", nickname]) do
start_pleroma()
+ Application.ensure_all_started(:flake_id)
with %User{local: true} = user <- User.get_cached_by_nickname(nickname) do
User.delete_user_activities(user)