about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-12-01 17:24:33 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-12-01 17:24:33 +0100
commitf60cd97638c9de9cbc4714cfbc87a321324fe9ff (patch)
tree078862a0414cecad7f05be91d5b3a72edb807692 /app/models
parentd70268f0991ba69568112d4da5768e821d5983dd (diff)
Only normalize local polls (#12515)
Before this patch, if remote poll options have leading or trailing spaces,
the information stored locally won't match them, causing federated voting to
fail.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/poll.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/poll.rb b/app/models/poll.rb
index 5427368fd..b5deafcc2 100644
--- a/app/models/poll.rb
+++ b/app/models/poll.rb
@@ -36,7 +36,7 @@ class Poll < ApplicationRecord
   scope :attached, -> { where.not(status_id: nil) }
   scope :unattached, -> { where(status_id: nil) }
 
-  before_validation :prepare_options
+  before_validation :prepare_options, if: :local?
   before_validation :prepare_votes_count
 
   after_initialize :prepare_cached_tallies