fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor carousel fixes.
[wolnelektury.git]
/
src
/
polls
/
views.py
diff --git
a/src/polls/views.py
b/src/polls/views.py
index
79540c6
..
ffafd2a
100644
(file)
--- a/
src/polls/views.py
+++ b/
src/polls/views.py
@@
-3,8
+3,7
@@
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.core.urlresolvers import reverse
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.core.urlresolvers import reverse
-from django.shortcuts import get_object_or_404, redirect, render_to_response
-from django.template import RequestContext
+from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators import cache
from django.views.decorators.http import require_http_methods
from django.views.decorators import cache
from django.views.decorators.http import require_http_methods
@@
-15,12
+14,11
@@
from .forms import PollForm
@cache.never_cache
@require_http_methods(['GET', 'POST'])
def poll(request, slug):
@cache.never_cache
@require_http_methods(['GET', 'POST'])
def poll(request, slug):
-
poll = get_object_or_404(Poll, slug=slug, open=True)
if request.method == 'POST':
poll = get_object_or_404(Poll, slug=slug, open=True)
if request.method == 'POST':
- redirect_to = reverse('poll', args
=
[slug])
- form = PollForm(request.POST, poll
=
poll)
+ redirect_to = reverse('poll', args
=
[slug])
+ form = PollForm(request.POST, poll
=
poll)
if form.is_valid():
if not poll.voted(request.session):
try:
if form.is_valid():
if not poll.voted(request.session):
try:
@@
-31,7
+29,7
@@
def poll(request, slug):
poll_item.vote(request.session)
return redirect(redirect_to)
elif request.method == 'GET':
poll_item.vote(request.session)
return redirect(redirect_to)
elif request.method == 'GET':
- context =
RequestContext(request)
+ context =
{}
context['poll'] = poll
context['voted_already'] = poll.voted(request.session)
context['poll'] = poll
context['voted_already'] = poll.voted(request.session)
- return render
_to_response(
'polls/poll.html', context)
+ return render
(request,
'polls/poll.html', context)