mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-03 05:48:42 +00:00
Dialyzer: pattern_match The pattern can never match the type {:diff, false}.
This commit is contained in:
parent
1d0e3b1355
commit
06ce5e3b43
1 changed files with 5 additions and 6 deletions
|
@ -118,14 +118,13 @@ defmodule Pleroma.User.Backup do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp permitted?(user) do
|
defp permitted?(user) do
|
||||||
with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)},
|
with {_, %__MODULE__{inserted_at: inserted_at}} <- {:last, get_last(user)} do
|
||||||
days = Config.get([__MODULE__, :limit_days]),
|
days = Config.get([__MODULE__, :limit_days])
|
||||||
diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days),
|
diff = Timex.diff(NaiveDateTime.utc_now(), inserted_at, :days)
|
||||||
{_, true} <- {:diff, diff > days} do
|
|
||||||
true
|
diff > days
|
||||||
else
|
else
|
||||||
{:last, nil} -> true
|
{:last, nil} -> true
|
||||||
{:diff, false} -> false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue