mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: don't error out when updating a topic with no changes
This commit is contained in:
@ -123,8 +123,8 @@ class TopicsController < ApplicationController
|
||||
guardian.ensure_can_edit!(topic)
|
||||
|
||||
changes = {}
|
||||
changes[:title] = params[:title] if params[:title]
|
||||
changes[:category_id] = params[:category_id] if params[:category_id]
|
||||
changes[:title] = params[:title] if params[:title] && topic.title != params[:title]
|
||||
changes[:category_id] = params[:category_id] if params[:category_id] && topic.category_id != params[:category_id].to_i
|
||||
|
||||
success = true
|
||||
|
||||
|
Reference in New Issue
Block a user