Tags: don't allow deprecation of tags without wiki
This commit is contained in:
@@ -131,13 +131,19 @@ class BulkUpdateRequestProcessor
|
||||
|
||||
when :deprecate
|
||||
tag = Tag.find_by_name(args[0])
|
||||
if tag.is_deprecated?
|
||||
if tag.nil?
|
||||
errors.add(:base, "Can't deprecate #{args[0]} (tag doesn't exist)")
|
||||
elsif tag.is_deprecated?
|
||||
errors.add(:base, "Can't deprecate #{args[0]} (tag is already deprecated)")
|
||||
elsif tag.wiki_page.blank?
|
||||
errors.add(:base, "Can't deprecate #{args[0]} (tag must have a wiki page)")
|
||||
end
|
||||
|
||||
when :undeprecate
|
||||
tag = Tag.find_by_name(args[0])
|
||||
if !tag.is_deprecated?
|
||||
if tag.nil?
|
||||
errors.add(:base, "Can't undeprecate #{args[0]} (tag doesn't exist)")
|
||||
elsif !tag.is_deprecated?
|
||||
errors.add(:base, "Can't undeprecate #{args[0]} (tag is not deprecated)")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user