John Costa avatar 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' % (
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.