Skip to content

Commit

Permalink
Merge pull request #165 from benadida/benadida/small-fixes-2017-05
Browse files Browse the repository at this point in the history
Benadida/small fixes 2017 05
  • Loading branch information
benadida committed May 28, 2017
2 parents c69f638 + a5fc099 commit 8af82e5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helios/templates/voters_email.html
Expand Up @@ -47,7 +47,7 @@ <h2 class="title">{{election.name}} &mdash; Contact Voters <span style="font-siz
{{email_form.as_table}}
</table>
<div>
<label for="">&nbsp;</label><input type="submit" value="Send" id="send_button" />
<label for="">&nbsp;</label><input type="submit" value="Send" id="send_button" class="button" />
</div>
</form>

Expand Down
2 changes: 2 additions & 0 deletions helios/templates/voters_list.html
Expand Up @@ -125,7 +125,9 @@ <h3 class="title">{{election.name}} &mdash; Voters and Ballot Tracking Center <s
{% if admin_p or not election.use_voter_aliases %}
<td>
{% if admin_p %}
{% if election.frozen_at %}
[<a href="{% url "helios.views.voters_email" election.uuid %}?voter_id={{voter.voter_login_id}}">email</a>]
{% endif %}
[<a onclick="return confirm('are you sure you want to remove {{voter.name}} ?');" href="{% url "helios.views.voter_delete" election.uuid voter.uuid %}">x</a>]
{% endif %}
<img class="small-logo" src="/static/auth/login-icons/{{voter.voter_type}}.png" alt="{{voter.voter_type}}" /> {{voter.name}}</td>
Expand Down
14 changes: 11 additions & 3 deletions helios/views.py
Expand Up @@ -550,7 +550,7 @@ def password_voter_login(request, election):
"""
This is used to log in as a voter for a particular election
"""

# the URL to send the user to after they've logged in
return_url = request.REQUEST.get('return_url', reverse(one_election_cast_confirm, args=[election.uuid]))
bad_voter_login = (request.GET.get('bad_voter_login', "0") == "1")
Expand Down Expand Up @@ -598,7 +598,15 @@ def password_voter_login(request, election):
})

return HttpResponseRedirect(settings.SECURE_URL_HOST + redirect_url)

else:
# bad form, bad voter login
redirect_url = login_url + "?" + urllib.urlencode({
'bad_voter_login' : '1',
'return_url' : return_url
})

return HttpResponseRedirect(settings.SECURE_URL_HOST + redirect_url)

return HttpResponseRedirect(settings.SECURE_URL_HOST + return_url)

@election_view()
Expand Down Expand Up @@ -1362,7 +1370,7 @@ def voters_email(request, election):
})

if request.method == "GET":
email_form = forms.EmailVotersForm()
email_form = forms.EmailVotersForm(initial={'subject': election.name, 'body': ' '})
if voter:
email_form.fields['send_to'].widget = email_form.fields['send_to'].hidden_widget()
else:
Expand Down

0 comments on commit 8af82e5

Please sign in to comment.