mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
don't error if no tag is given
This commit is contained in:
parent
03301168c7
commit
dafb048302
2 changed files with 4 additions and 1 deletions
|
@ -1,2 +1,2 @@
|
||||||
h1 Edit Link
|
h1 Edit Link
|
||||||
= render PhilomenaWeb.Profile.UserLinkView, "_form.html", conn: @conn, changeset: @changeset, tag_name: @user_link.tag.name, action: Routes.profile_user_link_path(@conn, :update, @user_link.user, @user_link)
|
= render PhilomenaWeb.Profile.UserLinkView, "_form.html", conn: @conn, changeset: @changeset, tag_name: tag_name(@user_link), action: Routes.profile_user_link_path(@conn, :update, @user_link.user, @user_link)
|
||||||
|
|
|
@ -14,4 +14,7 @@ defmodule PhilomenaWeb.Profile.UserLinkView do
|
||||||
|
|
||||||
def public_as_string(%{public: true}), do: "Yes"
|
def public_as_string(%{public: true}), do: "Yes"
|
||||||
def public_as_string(_user_link), do: "No"
|
def public_as_string(_user_link), do: "No"
|
||||||
|
|
||||||
|
def tag_name(%{tag: nil}), do: nil
|
||||||
|
def tag_name(%{tag: tag}), do: tag.name
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue