FIX: Changing owner of small action post failed

Small action posts for invites (CC from email) have a blank raw and revising of posts with blank raw didn't work anymore.
This commit is contained in:
Gerhard Schlager
2019-01-19 13:38:25 +01:00
parent 502b1316d0
commit f8ded9cec9
2 changed files with 14 additions and 4 deletions

View File

@@ -121,8 +121,6 @@ class PostRevisor
@topic_changes = TopicChanges.new(@topic, editor)
return false if @fields.has_key?(:raw) && @fields[:raw].blank?
# some normalization
@fields[:raw] = cleanup_whitespaces(@fields[:raw]) if @fields.has_key?(:raw)
@fields[:user_id] = @fields[:user_id].to_i if @fields.has_key?(:user_id)
@@ -207,7 +205,7 @@ class PostRevisor
end
def cleanup_whitespaces(raw)
TextCleaner.normalize_whitespaces(raw).gsub(/\s+\z/, "")
raw.present? ? TextCleaner.normalize_whitespaces(raw).gsub(/\s+\z/, "") : ""
end
def should_revise?