From: John Dong Date: Wed, 15 Aug 2007 21:04:30 +0000 (-0400) Subject: Merge jdong X-Git-Url: https://projects.mako.cc/source/selectricity/commitdiff_plain/66e774fa70c7ec116de558b0b4c4c07cd9d0e270?hp=068426e8c7a575e705d6f92fb0528f84780f1de7 Merge jdong --- diff --git a/app/models/selectricity_service.rb b/app/models/selectricity_service.rb index 86458e0..add5ab9 100644 --- a/app/models/selectricity_service.rb +++ b/app/models/selectricity_service.rb @@ -7,6 +7,7 @@ class SelectricityService < ActionWebService::Base if election voter = QuickVoter.new voter.election = election + voter.ipaddress = "XMLRPC Request" voter.session_id = "XMLRPC:#{voter_id}" voter.vote=Vote.new voter.vote.votes=vote_list[0] diff --git a/app/views/quickvote/results.rhtml b/app/views/quickvote/results.rhtml index 1fad7ea..98a71e5 100644 --- a/app/views/quickvote/results.rhtml +++ b/app/views/quickvote/results.rhtml @@ -1,4 +1,4 @@ -<% %> +<%require 'IPAddr' %>

Results

<% if @election.shortdesc %> @@ -156,7 +156,13 @@ by several other names.

<% next unless voter.voted? %> <%= voter.ipaddress %> - <%= `host #{voter.ipaddress}`.sub(/^.*pointer (.*)\.$/, '\1') %> + <% begin %> + <%= `host #{IPAddr.new(voter.ipaddress).to_s}`.sub(/^.*pointer (.*)\.$/, '\1') %> + + <% rescue ArgumentError => err %> + <%= " - " %> + <% end %> + <%= voter.vote.votestring %> <% end %>