Commits

John Costa committed 9ffa7bc

reverse next

Comments (0)

Files changed (1)

 from django.contrib.contenttypes.models import ContentType
 from django.core.exceptions import ObjectDoesNotExist
+from django.core.urlresolvers import reverse
 from django.http import Http404, HttpResponse, HttpResponseRedirect
 from django.contrib.auth.views import redirect_to_login
 from django.template import loader, RequestContext
                                  'must define a get_absolute_url method or '
                                  'property.')
         Vote.objects.record_vote(obj, request.user, vote)
-        return HttpResponseRedirect(next)
+        try:
+            return HttpResponseRedirect(next)
+        except:
+            return HttpResponseRedirect(reverse(next))
     else:
         if not template_name:
             template_name = '%s/%s_confirm_vote.html' % (