Skip to content

Commit

Permalink
small bugfix to ignore blank POST requests
Browse files Browse the repository at this point in the history
  • Loading branch information
justquick committed Sep 7, 2010
1 parent 9bb1937 commit 29aed38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pollit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def detail(request, year, month, slug, template_name="pollit/detail.html"):
if has_voted:
return HttpResponseRedirect("%sresults/" % poll.get_absolute_url())
# If user is logged in and has not voted
if request.method == "POST" and request.user.is_authenticated() and not has_voted:
if request.POST.items() and request.user.is_authenticated() and not has_voted:
try:
selected_choice = PollChoice.objects.get(pk=request.POST['choice'])
except PollChoice.DoesNotExist:
Expand Down Expand Up @@ -77,4 +77,4 @@ def results(request, year, month, slug, template_name="pollit/results.html"):
{'poll': poll},
context_instance=RequestContext(request))



0 comments on commit 29aed38

Please sign in to comment.