Browse Source

Redirect após post

pull/906/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
57a4f20446
  1. 4
      sapl/painel/views.py
  2. 2
      sapl/templates/painel/voto_nominal.html

4
sapl/painel/views.py

@ -1,3 +1,5 @@
from django.http.response import HttpResponseRedirect
from django.core.urlresolvers import reverse
from datetime import date
from sapl.utils import get_client_ip
@ -115,6 +117,8 @@ def votante_view(request, pk):
voto.voto = request.POST['voto']
voto.ip = get_client_ip(request)
voto.save()
return HttpResponseRedirect(
reverse('sapl.painel:voto_individual', kwargs={'pk': pk}))
return render(request, 'painel/voto_nominal.html', context)

2
sapl/templates/painel/voto_nominal.html

@ -54,7 +54,7 @@
<option value="">Selecione</option>
<option value="Sim">Sim</option>
<option value="Não">Não</option>
<option value="Absteção">Abstenção</option>
<option value="Abstenção">Abstenção</option>
</select>
</th></tr>
<tr><th style="text-align:center">

Loading…
Cancel
Save