Require at least 2 candidates to open a vote
This commit is contained in:
parent
440013890e
commit
dc01cb61ad
2 changed files with 9 additions and 2 deletions
6
vote.rb
6
vote.rb
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue