BURs: fix not being able to approve deprecation when tag is already deprecated.
Fix a bug where you couldn't approve a BUR deprecating a tag if that tag was already deprecated by a separate BUR.
This commit is contained in:
@@ -131,7 +131,10 @@ class BulkUpdateRequestProcessor
|
|||||||
|
|
||||||
when :deprecate
|
when :deprecate
|
||||||
tag = Tag.find_by_name(args[0])
|
tag = Tag.find_by_name(args[0])
|
||||||
if tag.nil?
|
|
||||||
|
if validation_context == :approval
|
||||||
|
# ignore already deprecated tags and missing wikis when approving a tag deprecation.
|
||||||
|
elsif tag.nil?
|
||||||
errors.add(:base, "Can't deprecate #{args[0]} (tag doesn't exist)")
|
errors.add(:base, "Can't deprecate #{args[0]} (tag doesn't exist)")
|
||||||
elsif tag.is_deprecated?
|
elsif tag.is_deprecated?
|
||||||
errors.add(:base, "Can't deprecate #{args[0]} (tag is already deprecated)")
|
errors.add(:base, "Can't deprecate #{args[0]} (tag is already deprecated)")
|
||||||
@@ -141,7 +144,10 @@ class BulkUpdateRequestProcessor
|
|||||||
|
|
||||||
when :undeprecate
|
when :undeprecate
|
||||||
tag = Tag.find_by_name(args[0])
|
tag = Tag.find_by_name(args[0])
|
||||||
if tag.nil?
|
|
||||||
|
if validation_context == :approval
|
||||||
|
# ignore already deprecated tags and missing wikis when removing a tag deprecation.
|
||||||
|
elsif tag.nil?
|
||||||
errors.add(:base, "Can't undeprecate #{args[0]} (tag doesn't exist)")
|
errors.add(:base, "Can't undeprecate #{args[0]} (tag doesn't exist)")
|
||||||
elsif !tag.is_deprecated?
|
elsif !tag.is_deprecated?
|
||||||
errors.add(:base, "Can't undeprecate #{args[0]} (tag is not deprecated)")
|
errors.add(:base, "Can't undeprecate #{args[0]} (tag is not deprecated)")
|
||||||
|
|||||||
Reference in New Issue
Block a user