artists: fix error messages for invalid artist names.
* When trying to create an artist entry for a non-artist tag, set the error on the name attribute so that the artist name gets marked as incorrect in the artist edit form. * Fix a bad `Name '' cannot be blank` error message when the artist name is blank. * Fix showing wiki pages of non-artist tags in the artist edit form when the artist name conflicts with a non-artist tag (e.g. if you try to create an artist named '1girl', don't show the wiki for 1girl in the artist edit form).
This commit is contained in:
@@ -10,7 +10,7 @@ class TagNameValidator < ActiveModel::EachValidator
|
||||
|
||||
case value
|
||||
when /\A_*\z/
|
||||
record.errors.add(attribute, "'#{value}' cannot be blank")
|
||||
record.errors.add(attribute, "cannot be blank")
|
||||
when /\*/
|
||||
record.errors.add(attribute, "'#{value}' cannot contain asterisks ('*')")
|
||||
when /,/
|
||||
|
||||
Reference in New Issue
Block a user