projects
/
selectricity
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4a5eeb
)
Fix error when getting a quickvote result of nonexistent ident
author
John Dong
<jdong@mit.edu>
Mon, 20 Aug 2007 20:05:46 +0000
(16:05 -0400)
committer
John Dong
<jdong@mit.edu>
Mon, 20 Aug 2007 20:05:46 +0000
(16:05 -0400)
app/controllers/quickvote_controller.rb
patch
|
blob
|
history
diff --git
a/app/controllers/quickvote_controller.rb
b/app/controllers/quickvote_controller.rb
index 0d9eb7be4c934c2a08640ab78a2c5bb99b34849f..5b3acab79f21998d5897e90cc331b71745c37b8c 100644
(file)
--- a/
app/controllers/quickvote_controller.rb
+++ b/
app/controllers/quickvote_controller.rb
@@
-156,7
+156,11
@@
class QuickvoteController < ApplicationController
###############################################################
def results
- @election = QuickVote.ident_to_quickvote(params[:ident])
+ unless @election = QuickVote.ident_to_quickvote(params[:ident])
+ flash[:notice] = "Cannot find quickvote #{params[:ident]}."
+ redirect_to :controller => 'site'
+ return
+ end
@election.results
@candidates = {}
@election.candidates.each {|c| @candidates[c.id] = c}
Benjamin Mako Hill
||
Want to submit a patch?