Require at least 2 candidates to open a vote

This commit is contained in:
ricola 2025-04-06 17:04:31 -06:00
parent 440013890e
commit dc01cb61ad
2 changed files with 9 additions and 2 deletions

View file

@ -200,8 +200,10 @@ post '/votes/:id/open' do
find_vote
require_organizer
require_draft_vote
@vote.state = 'open'
@vote.save
if not @vote.candidates.length < 2
@vote.state = 'open'
@vote.save
end
redirect '/votes/' + @vote.secure_id
end