mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Fix custom emoji category creation silently erroring out on duplicate category (#12647)
Instead, just re-use the existing category if any. Fixes #12608
This commit is contained in:
parent
fb9137752a
commit
c0ed53b810
@ -40,7 +40,7 @@ class Form::CustomEmojiBatch
|
||||
if category_id.present?
|
||||
CustomEmojiCategory.find(category_id)
|
||||
elsif category_name.present?
|
||||
CustomEmojiCategory.create!(name: category_name)
|
||||
CustomEmojiCategory.find_or_create_by!(name: category_name)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user