Don't explicitly rollback transaction in paypal_error
authorMagnus Hagander <magnus@hagander.net>
Mon, 8 Jan 2018 16:03:30 +0000 (17:03 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 8 Jan 2018 16:03:30 +0000 (17:03 +0100)
We can't do that inside a @transaction.atomic block. It's also not
necessary, because paypal_error is only called before any database
modifications are made, and returns out of the view directly.

postgresqleu/paypal/views.py

index 6969813cd5725fbdd729da00d68a8fa87cbb973b..224bd19866335ff2b572cea0f5cf965337d6da92 100644 (file)
@@ -21,9 +21,6 @@ def paypal_return_handler(request):
 
        # Custom error return that can get to the request context
        def paypal_error(reason):
-               # Explicitly roll back the transaction, since our
-               # error page will look like a success to django...
-               transaction.rollback()
                return render_to_response('paypal/error.html', {
                                'reason': reason,
                                }, context_instance=RequestContext(request))