philomena/lib/philomena_web/views/ban_view.ex

8 lines
168 B
Elixir
Raw Normal View History

2019-12-08 21:32:54 +01:00
defmodule PhilomenaWeb.BanView do
use PhilomenaWeb, :view
def active?(ban) do
ban.enabled and DateTime.diff(ban.valid_until, DateTime.utc_now()) > 0
2019-12-08 21:32:54 +01:00
end
end