Commit c0ed53b8 authored by ThibG's avatar ThibG Committed by Eugen Rochko

Fix custom emoji category creation silently erroring out on duplicate category (#12647)

Instead, just re-use the existing category if any.

Fixes #12608
parent fb913775
......@@ -40,7 +40,7 @@ class Form::CustomEmojiBatch
if category_id.present?
elsif category_name.present?
CustomEmojiCategory.create!(name: category_name)
CustomEmojiCategory.find_or_create_by!(name: category_name)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment