Skip to content
Snippets Groups Projects
Commit c0ed53b8 authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment