summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/notes_actions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/notes_actions.rb')
-rw-r--r--app/controllers/concerns/notes_actions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/concerns/notes_actions.rb b/app/controllers/concerns/notes_actions.rb
index fbae4c53c31..3d599d9e7f9 100644
--- a/app/controllers/concerns/notes_actions.rb
+++ b/app/controllers/concerns/notes_actions.rb
@@ -63,7 +63,11 @@ module NotesActions
json.merge!(note_json(@note))
end
- render json: json
+ if @note.errors.present? && @note.errors.keys != [:commands_only]
+ render json: json, status: :unprocessable_entity
+ else
+ render json: json
+ end
end
format.html { redirect_back_or_default }
end