projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update docs
[akkoma]
/
lib
/
pleroma
/
user_invite_token.ex
diff --git
a/lib/pleroma/user_invite_token.ex
b/lib/pleroma/user_invite_token.ex
index 86f0a548690c00ff7e482efa536688757f45a1aa..a08ba99f1107710aa33e794f791c9562992ceaee 100644
(file)
--- a/
lib/pleroma/user_invite_token.ex
+++ b/
lib/pleroma/user_invite_token.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.UserInviteToken do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.UserInviteToken do
@@
-24,7
+24,7
@@
defmodule Pleroma.UserInviteToken do
timestamps()
end
timestamps()
end
- @spec create_invite(map()) ::
UserInviteToken.t()
+ @spec create_invite(map()) ::
{:ok, UserInviteToken.t()}
def create_invite(params \\ %{}) do
%UserInviteToken{}
|> cast(params, [:max_use, :expires_at])
def create_invite(params \\ %{}) do
%UserInviteToken{}
|> cast(params, [:max_use, :expires_at])
@@
-74,7
+74,7
@@
defmodule Pleroma.UserInviteToken do
@spec find_by_token(token()) :: {:ok, UserInviteToken.t()} | nil
def find_by_token(token) do
@spec find_by_token(token()) :: {:ok, UserInviteToken.t()} | nil
def find_by_token(token) do
- with invite <- Repo.get_by(UserInviteToken, token: token) do
+ with
%UserInviteToken{} =
invite <- Repo.get_by(UserInviteToken, token: token) do
{:ok, invite}
end
end
{:ok, invite}
end
end