fix(back): Replace NaiveDateTime uses with DateTime for consistency

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-05-17 09:02:28 +02:00
parent aa20f69911
commit 8ea00e7c18
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -287,7 +287,7 @@ defmodule Mobilizon.Applications do
@spec prune_old_application_tokens(pos_integer()) :: {non_neg_integer(), nil}
def prune_old_application_tokens(lifetime) do
exp = DateTime.add(NaiveDateTime.utc_now(), -lifetime)
exp = DateTime.add(DateTime.utc_now(), -lifetime)
ApplicationToken
|> 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}
def prune_old_application_device_activations(lifetime) do
exp = DateTime.add(NaiveDateTime.utc_now(), -lifetime)
exp = DateTime.add(DateTime.utc_now(), -lifetime)
ApplicationDeviceActivation
|> where([at], at.expires_in < ^exp)