Skip to content

Commit 40fac18

Browse files
Gargronhiyuki2578
authored andcommitted
Fix vote validation for polls with multiple choices (mastodon#10138)
1 parent 0a2d55b commit 40fac18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/validators/vote_validator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def validate(vote)
66

77
if vote.poll.multiple? && vote.poll.votes.where(account: vote.account, choice: vote.choice).exists?
88
vote.errors.add(:base, I18n.t('polls.errors.already_voted'))
9-
elsif vote.poll.votes.where(account: vote.account).exists?
9+
elsif !vote.poll.multiple? && vote.poll.votes.where(account: vote.account).exists?
1010
vote.errors.add(:base, I18n.t('polls.errors.already_voted'))
1111
end
1212
end

0 commit comments

Comments
 (0)