don't try to redirect when there is no tag to redirect

This commit is contained in:
byte[] 2019-12-15 10:36:26 -05:00
parent 62885b51df
commit 8a7ca9dbcb

View file

@ -9,7 +9,7 @@ defmodule PhilomenaWeb.TagController do
plug PhilomenaWeb.RecodeParameterPlug, [name: "id"] when action in [:show] plug PhilomenaWeb.RecodeParameterPlug, [name: "id"] when action in [:show]
plug PhilomenaWeb.CanaryMapPlug, update: :edit plug PhilomenaWeb.CanaryMapPlug, update: :edit
plug :load_and_authorize_resource, model: Tag, id_field: "slug", only: [:show, :edit, :update, :delete], preload: [:aliases, :aliased_tag, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user] plug :load_and_authorize_resource, model: Tag, id_field: "slug", only: [:show, :edit, :update, :delete], preload: [:aliases, :aliased_tag, :implied_tags, :implied_by_tags, :dnp_entries, public_links: :user]
plug :redirect_alias plug :redirect_alias when action in [:show, :edit, :update, :delete]
def index(conn, params) do def index(conn, params) do
query_string = params["tq"] || "*" query_string = params["tq"] || "*"