BURs: move the is_banned flag when aliasing artists.

When a banned artist tag is aliased into a nonbanned artist tag, move
the is_banned flag from the old artist entry to the new artist_entry.

Related to #4940. Fixes a case where a banned artist could lose the
banned status when it was moved.
This commit is contained in:
evazion
2022-01-11 11:16:48 -06:00
parent 40d6351249
commit f8768fd6b7
2 changed files with 13 additions and 0 deletions

View File

@@ -156,12 +156,14 @@ class TagMover
new_artist.group_name = old_artist.group_name unless new_artist.group_name.present?
new_artist.url_string += "\n" + old_artist.url_string
new_artist.is_deleted = false
new_artist.is_banned = old_artist.is_banned || new_artist.is_banned
new_artist.save!
old_artist.other_names = [new_artist.name]
old_artist.group_name = ""
old_artist.url_string = ""
old_artist.is_deleted = true
old_artist.is_banned = false
old_artist.save!
end