diff options
author | Alex S <alex.strizhakov@gmail.com> | 2019-04-06 20:24:22 +0700 |
---|---|---|
committer | Alex S <alex.strizhakov@gmail.com> | 2019-04-06 20:24:22 +0700 |
commit | 47b07cec495528ce22f83ca56717cc74aa0096f3 (patch) | |
tree | 025b3ebaa20e506c1f28c120757977d1536bc4e0 /lib/mix/tasks | |
parent | be54e40890432d2cd8e592e6d4acfa9f1e98586c (diff) | |
download | pleroma-47b07cec495528ce22f83ca56717cc74aa0096f3.tar.gz |
token -> invite renaming
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r-- | lib/mix/tasks/pleroma/user.ex | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index 00a933292..887f45029 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -315,19 +315,19 @@ defmodule Mix.Tasks.Pleroma.User do end options = Keyword.put(options, :expire_at, expire_at) - + options = Enum.into(options, %{}) Common.start_pleroma() - with {:ok, token} <- UserInviteToken.create_token(options) do + with {:ok, invite} <- UserInviteToken.create_invite(options) do Mix.shell().info( - "Generated user invite token " <> String.replace(token.token_type, "_", " ") + "Generated user invite token " <> String.replace(invite.invite_type, "_", " ") ) url = Pleroma.Web.Router.Helpers.redirect_url( Pleroma.Web.Endpoint, :registration_page, - token.token + invite.token ) IO.puts(url) @@ -367,7 +367,9 @@ defmodule Mix.Tasks.Pleroma.User do def run(["invite_revoke", token]) do Common.start_pleroma() - with {:ok, _} <- UserInviteToken.mark_as_used(token) do + invite = UserInviteToken.find_by_token!(token) + + with {:ok, _} <- UserInviteToken.update_invite(invite, %{used: true}) do Mix.shell().info("Invite for token #{token} was revoked.") else _ -> Mix.shell().error("No invite found with token #{token}") |