diff --git a/lib/philomena_web/controllers/admin/user/erase_controller.ex b/lib/philomena_web/controllers/admin/user/erase_controller.ex index d101db57..b481068e 100644 --- a/lib/philomena_web/controllers/admin/user/erase_controller.ex +++ b/lib/philomena_web/controllers/admin/user/erase_controller.ex @@ -15,7 +15,6 @@ defmodule PhilomenaWeb.Admin.User.EraseController do plug :prevent_deleting_privileged_users plug :prevent_deleting_verified_users - plug :prevent_deleting_old_users def new(conn, _params) do render(conn, "new.html", title: "Erase user") @@ -57,18 +56,4 @@ defmodule PhilomenaWeb.Admin.User.EraseController do conn end end - - defp prevent_deleting_old_users(conn, _opts) do - now = DateTime.utc_now(:second) - two_weeks = 1_209_600 - - if DateTime.compare(now, DateTime.add(conn.assigns.user.created_at, two_weeks)) == :gt do - conn - |> put_flash(:error, "Cannot erase a user older than two weeks") - |> redirect(to: ~p"/profiles/#{conn.assigns.user}") - |> Plug.Conn.halt() - else - conn - end - end end