fix(back): Replace NaiveDateTime uses with DateTime for consistency
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
aa20f69911
commit
8ea00e7c18
|
@ -287,7 +287,7 @@ defmodule Mobilizon.Applications do
|
||||||
|
|
||||||
@spec prune_old_application_tokens(pos_integer()) :: {non_neg_integer(), nil}
|
@spec prune_old_application_tokens(pos_integer()) :: {non_neg_integer(), nil}
|
||||||
def prune_old_application_tokens(lifetime) do
|
def prune_old_application_tokens(lifetime) do
|
||||||
exp = DateTime.add(NaiveDateTime.utc_now(), -lifetime)
|
exp = DateTime.add(DateTime.utc_now(), -lifetime)
|
||||||
|
|
||||||
ApplicationToken
|
ApplicationToken
|
||||||
|> where([at], at.status != :success)
|
|> where([at], at.status != :success)
|
||||||
|
@ -426,7 +426,7 @@ defmodule Mobilizon.Applications do
|
||||||
|
|
||||||
@spec prune_old_application_device_activations(pos_integer()) :: {non_neg_integer(), nil}
|
@spec prune_old_application_device_activations(pos_integer()) :: {non_neg_integer(), nil}
|
||||||
def prune_old_application_device_activations(lifetime) do
|
def prune_old_application_device_activations(lifetime) do
|
||||||
exp = DateTime.add(NaiveDateTime.utc_now(), -lifetime)
|
exp = DateTime.add(DateTime.utc_now(), -lifetime)
|
||||||
|
|
||||||
ApplicationDeviceActivation
|
ApplicationDeviceActivation
|
||||||
|> where([at], at.expires_in < ^exp)
|
|> where([at], at.expires_in < ^exp)
|
||||||
|
|
Loading…
Reference in a new issue