diff --git a/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime b/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime index 0a60cba4..1e262a35 100644 --- a/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime +++ b/lib/philomena_web/templates/duplicate_report/_image_cell.html.slime @@ -16,7 +16,7 @@ p = render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: @image, conn: @conn - = if can?(@conn, :edit, @report) and same_rating_tags?(@report) do + = if can?(@conn, :edit, @report) and mergeable?(@report) do = if @source do a href=Routes.duplicate_report_accept_reverse_path(@conn, :create, @report) data-method="post" button.button diff --git a/lib/philomena_web/views/duplicate_report_view.ex b/lib/philomena_web/views/duplicate_report_view.ex index ed30407d..f1224dd0 100644 --- a/lib/philomena_web/views/duplicate_report_view.ex +++ b/lib/philomena_web/views/duplicate_report_view.ex @@ -102,6 +102,10 @@ defmodule PhilomenaWeb.DuplicateReportView do def both_are_alternate_versions?(%{image: image, duplicate_of_image: duplicate_of_image}), do: alternate_version?(image) and alternate_version?(duplicate_of_image) + def mergeable?(%{image: image, duplicate_of_image: duplicate_of_image} = report) do + same_rating_tags?(report) and not image.hidden_from_users and not duplicate_of_image.hidden_from_users + end + defp artist_tags(%{tags: tags}) do tags |> Enum.filter(&(&1.namespace == "artist"))