FIX: post mover validation color and message (#15688)

When the record is not saved, we should display a proper message.
One potential reason can be plugins for example discourse-calendar is specifying that only first post can contain event
This commit is contained in:
Krzysztof Kotlarek
2022-02-02 16:22:52 +11:00
committed by GitHub
parent 3da6f6b717
commit bb01563682
4 changed files with 18 additions and 3 deletions

View File

@ -839,7 +839,7 @@ class TopicsController < ApplicationController
destination_topic = move_posts_to_destination(topic)
render_topic_changes(destination_topic)
rescue ActiveRecord::RecordInvalid => ex
rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => ex
render_json_error(ex)
end