X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/da8a3c5c6efcad4e4a5424a09c0479f7ee52a9ec..bef19cbd240e996414af3e5c84fb1f8d8357340f:/app/controllers/quickvote_controller.rb?ds=inline diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index 5bf89c7..4b3c0c9 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -44,6 +44,7 @@ class QuickvoteController < ApplicationController #Give registered users additional QuickVote functionality @quickvote.user_id = session[:user][:id] if session[:user] + @quickvote.create_candidates # try to save, if it fails, show the page again (the flash should # still be intact @@ -96,6 +97,13 @@ class QuickvoteController < ApplicationController # if the person has specified an election, we show them the voting # page. otherwise, we redirect back to main the page if @election + + # if the election is over, redirect to the the results page + unless @election.active? + redirect_to quickaction_url(:ident => params[:ident], + :action => 'results') + end + # look to see that the voter has been created and has voted in # this election, and has confirmed their vote @voter = QuickVoter.find(:all,