X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser.ex;h=8e40dfc0d846b55ee67dfcc6b8c482060a99a6a7;hb=b63dd6a5a2a467924e0c98585b393630b2d44341;hp=455e08c8824746a3c1838c232d516f46bcf66d37;hpb=6b3842cf50c063a63980c8d4dca93b25424059f2;p=akkoma diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 455e08c88..8e40dfc0d 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2246,7 +2246,7 @@ defmodule Pleroma.User do def change_email(user, email) do user |> cast(%{email: email}, [:email]) - |> validate_required([:email]) + |> maybe_validate_required_email(false) |> unique_constraint(:email) |> validate_format(:email, @email_regex) |> update_and_set_cache() @@ -2474,8 +2474,8 @@ defmodule Pleroma.User do |> update_and_set_cache() end - def active_user_count(weeks \\ 4) do - active_after = Timex.shift(NaiveDateTime.utc_now(), weeks: -weeks) + def active_user_count(days \\ 30) do + active_after = Timex.shift(NaiveDateTime.utc_now(), days: -days) __MODULE__ |> where([u], u.last_active_at >= ^active_after)