require that the tag not be an alias

This commit is contained in:
byte[] 2019-12-07 21:00:36 -05:00
parent 5d4f8f83f6
commit 64884b3dc8

View file

@ -78,9 +78,10 @@ defmodule PhilomenaWeb.ImageLoader do
Tag
|> join(:left, [t], at in Tag, on: t.id == at.aliased_tag_id)
|> where([t, at], t.name in ^tags or at.name in ^tags)
|> preload([:aliases, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user])
|> preload([:aliases, :aliased_tag, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user])
|> Repo.all()
|> Enum.uniq_by(& &1.id)
|> Enum.filter(&is_nil(&1.aliased_tag))
end
defp render_bodies([], _conn), do: []