Browse files

Also ensure unmanaged transaction is committed after purge

  • Loading branch information...
1 parent 9633db3 commit ac0905a07cdcce745bd07a72c2f26b1d9f07f1f7 @mhagander mhagander committed Oct 19, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 pgweb/survey/views.py
View
3 pgweb/survey/views.py
@@ -1,6 +1,6 @@
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse, Http404, HttpResponseRedirect
-from django.db import connection
+from django.db import connection, transaction
from django.template.defaultfilters import slugify
from django.views.decorators.csrf import csrf_exempt
@@ -58,6 +58,7 @@ def vote(request, surveyid):
# do it properly. Possibly because of the cute stuff we do with
# getattr/setattr above.
varnish_purge("/community/survey/%s/" % surveyid)
+ transaction.commit_unless_managed()
return HttpResponseRedirect("/community/survey/%s/" % surveyid)

0 comments on commit ac0905a

Please sign in to comment.