From 417305e43ce1111cdd827d70fdb9e7696188b96c Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 6 Jun 2020 21:56:07 -0400 Subject: [PATCH] filter fixes --- .../controllers/admin/user/force_filter_controller.ex | 2 +- lib/philomena_web/plugs/image_filter_plug.ex | 2 +- lib/philomena_web/templates/profile/_admin_block.html.slime | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/philomena_web/controllers/admin/user/force_filter_controller.ex b/lib/philomena_web/controllers/admin/user/force_filter_controller.ex index e32d9dfd..049d68fb 100644 --- a/lib/philomena_web/controllers/admin/user/force_filter_controller.ex +++ b/lib/philomena_web/controllers/admin/user/force_filter_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Admin.User.ForceFilterController do end def delete(conn, _params) do - {:ok, user} = Users.unforce_filter(conn.assigns.current_user) + {:ok, user} = Users.unforce_filter(conn.assigns.user) conn |> put_flash(:info, "Forced filter was removed.") diff --git a/lib/philomena_web/plugs/image_filter_plug.ex b/lib/philomena_web/plugs/image_filter_plug.ex index 9562c813..4a960a4a 100644 --- a/lib/philomena_web/plugs/image_filter_plug.ex +++ b/lib/philomena_web/plugs/image_filter_plug.ex @@ -14,7 +14,7 @@ defmodule PhilomenaWeb.ImageFilterPlug do filter = defaults(conn.assigns[:current_filter]) forced = defaults(conn.assigns[:forced_filter]) - tag_exclusion = %{terms: %{tag_ids: filter.hidden_tag_ids}} + tag_exclusion = %{terms: %{tag_ids: filter.hidden_tag_ids ++ forced.hidden_tag_ids}} query_spoiler = invalid_filter_guard(user, filter.spoilered_complex_str) query_exclusion = %{ bool: %{ diff --git a/lib/philomena_web/templates/profile/_admin_block.html.slime b/lib/philomena_web/templates/profile/_admin_block.html.slime index d010858e..3d188c5c 100644 --- a/lib/philomena_web/templates/profile/_admin_block.html.slime +++ b/lib/philomena_web/templates/profile/_admin_block.html.slime @@ -16,7 +16,7 @@ br i.fa.fa-fw.fa-filter> strong.comment_deleted> Forced Filter: - = link @forced.name, to: Routes.filter_path(@conn, :show, @filter) + = link @forced.name, to: Routes.filter_path(@conn, :show, @forced) br i.far.fa-fw.fa-clock>