removing not needed invite update
This commit is contained in:
parent
d0696fdfd6
commit
fee50636d0
@ -96,9 +96,8 @@ defmodule Pleroma.UserInviteToken do
|
||||
not_overdue_date?(invite) and invite.uses < invite.max_use and not invite.used
|
||||
end
|
||||
|
||||
defp not_overdue_date?(%{expires_at: expires_at} = invite) do
|
||||
Date.compare(Date.utc_today(), expires_at) in [:lt, :eq] ||
|
||||
(update_invite!(invite, %{used: true}) && false)
|
||||
defp not_overdue_date?(%{expires_at: expires_at}) do
|
||||
Date.compare(Date.utc_today(), expires_at) in [:lt, :eq]
|
||||
end
|
||||
|
||||
@spec update_usage!(UserInviteToken.t()) :: nil | UserInviteToken.t() | no_return()
|
||||
|
@ -492,7 +492,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
||||
refute User.get_by_nickname("vinny")
|
||||
invite = Repo.get_by(UserInviteToken, token: invite.token)
|
||||
|
||||
assert invite.used == true
|
||||
refute invite.used
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user