Fix vote-after-expiration not showing error, count vote as interaction (#10352)
parent
555c4e11ba
commit
9d0573f574
|
@ -11,14 +11,14 @@ class VoteService < BaseService
|
||||||
@choices = choices
|
@choices = choices
|
||||||
@votes = []
|
@votes = []
|
||||||
|
|
||||||
return if @poll.expired?
|
|
||||||
|
|
||||||
ApplicationRecord.transaction do
|
ApplicationRecord.transaction do
|
||||||
@choices.each do |choice|
|
@choices.each do |choice|
|
||||||
@votes << @poll.votes.create!(account: @account, choice: choice)
|
@votes << @poll.votes.create!(account: @account, choice: choice)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ActivityTracker.increment('activity:interactions')
|
||||||
|
|
||||||
if @poll.account.local?
|
if @poll.account.local?
|
||||||
distribute_poll!
|
distribute_poll!
|
||||||
else
|
else
|
||||||
|
|
Reference in New Issue