Accept 1 as true.

This commit is contained in:
eal 2017-11-14 15:50:23 +02:00
commit 06c3ee3bac
2 changed files with 8 additions and 2 deletions

View file

@ -159,7 +159,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
defp restrict_favorited_by(query, _), do: query
defp restrict_media(query, %{"only_media" => true}) do
defp restrict_media(query, %{"only_media" => val}) when val == "true" or val == "1" do
from activity in query,
where: fragment("not (? #> '{\"object\",\"attachment\"}' = ?)", activity.data, ^[])
end