mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-12-03 16:17: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
|
||||
tag = get_field(changeset, :tag)
|
||||
|
||||
case tag.category in ["origin", "content-fanmade"] do
|
||||
false -> add_error(changeset, :tag, "must be a creator tag")
|
||||
true -> changeset
|
||||
if not is_nil(tag) and tag.category not in ["origin", "content-fanmade"] do
|
||||
add_error(changeset, :tag, "must be a creator tag")
|
||||
else
|
||||
changeset
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue