If we don't commit the transaction, varnish purges are not sent
authorMagnus Hagander <magnus@hagander.net>
Sun, 29 Dec 2013 14:10:41 +0000 (15:10 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sun, 29 Dec 2013 14:10:41 +0000 (15:10 +0100)
The updates still gets saved, but the manually executed SQL in the
post save handler that creates the varnish purge gets rolled back.

pgweb/account/views.py

index dce4dbdde9ea0cd958ea8b0cbda76e6faccaef55..707d046c56584e57912864569913cd984c6ba1dd 100644 (file)
@@ -7,6 +7,7 @@ from django.utils.http import int_to_base36
 from django.contrib.auth.tokens import default_token_generator
 from django.contrib.auth import logout as django_logout
 from django.conf import settings
+from django.db import transaction
 
 import base64
 import urllib
@@ -71,6 +72,7 @@ objtypes = {
 
 @ssl_required
 @login_required
+@transaction.commit_on_success
 def profile(request):
        # We always have the user, but not always the profile. And we need a bit
        # of a hack around the normal forms code since we have two different