mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
fix nil tag error
This commit is contained in:
parent
533fa47d47
commit
21c17855f8
1 changed files with 4 additions and 3 deletions
|
@ -63,9 +63,10 @@ defmodule Philomena.ArtistLinks.ArtistLink do
|
||||||
def validate_category(changeset) do
|
def validate_category(changeset) do
|
||||||
tag = get_field(changeset, :tag)
|
tag = get_field(changeset, :tag)
|
||||||
|
|
||||||
case tag.category in ["origin", "content-fanmade"] do
|
if not is_nil(tag) and tag.category not in ["origin", "content-fanmade"] do
|
||||||
false -> add_error(changeset, :tag, "must be a creator tag")
|
add_error(changeset, :tag, "must be a creator tag")
|
||||||
true -> changeset
|
else
|
||||||
|
changeset
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue