diff --git a/lib/philomena/duplicate_reports.ex b/lib/philomena/duplicate_reports.ex index 180e27b5..1ba90050 100644 --- a/lib/philomena/duplicate_reports.ex +++ b/lib/philomena/duplicate_reports.ex @@ -102,6 +102,7 @@ defmodule Philomena.DuplicateReports do new_report = DuplicateReport |> where(duplicate_of_image_id: ^duplicate_report.image_id) + |> where(image_id: ^duplicate_report.duplicate_of_image_id) |> limit(1) |> Repo.one()