diff --git a/lib/philomena_web/controllers/image_controller.ex b/lib/philomena_web/controllers/image_controller.ex index 95f4ffae..6bd3d45c 100644 --- a/lib/philomena_web/controllers/image_controller.ex +++ b/lib/philomena_web/controllers/image_controller.ex @@ -149,7 +149,7 @@ defmodule PhilomenaWeb.ImageController do is_nil(image) -> PhilomenaWeb.NotFoundPlug.call(conn) - not is_nil(image.duplicate_id) and not Canada.Can.can?(conn, :show, image) -> + not is_nil(image.duplicate_id) and not Canada.Can.can?(conn.assigns.current_user, :show, image) -> conn |> put_flash(:info, "The image you were looking for has been marked a duplicate of the image below") |> redirect(to: Routes.image_path(conn, :show, image.duplicate_id)) diff --git a/lib/philomena_web/controllers/report_controller.ex b/lib/philomena_web/controllers/report_controller.ex index 79962009..6c99f96d 100644 --- a/lib/philomena_web/controllers/report_controller.ex +++ b/lib/philomena_web/controllers/report_controller.ex @@ -87,6 +87,6 @@ defmodule PhilomenaWeb.ReportController do reports_open >= 5 end - defp redirect_path(conn, nil), do: "/" + defp redirect_path(_conn, nil), do: "/" defp redirect_path(conn, _user), do: Routes.report_path(conn, :index) end \ No newline at end of file