From 48c52f4dcb99bc0a5480da12dcfa53012be61111 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sun, 31 Jan 2016 21:57:18 +0100 Subject: [PATCH] renew the session after payment (fix bug for logged in users) --- app/records/models.py | 6 +++++- app/records/static/css/dig2.css | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/records/models.py b/app/records/models.py index dfedc0c..116eaef 100644 --- a/app/records/models.py +++ b/app/records/models.py @@ -323,7 +323,7 @@ def payment_complete(sender, **kwargs): try: order = Order.objects.get( transaction_id=ipn_obj.invoice) - print order + # print order # order = Order.objects.get(key=s_key) for field in order.session_fields: if field in session: @@ -353,6 +353,10 @@ def payment_complete(sender, **kwargs): DiscountCode.objects.active().filter(code=code) \ .update(uses_remaining=F('uses_remaining') - 1) cart.delete() + + # renew the session (for logged in users) + session.flush() + except Order.DoesNotExist: pass except Cart.DoesNotExist: diff --git a/app/records/static/css/dig2.css b/app/records/static/css/dig2.css index 6cbc695..6462521 100644 --- a/app/records/static/css/dig2.css +++ b/app/records/static/css/dig2.css @@ -22,7 +22,6 @@ body { h1 { font-size: 230%; - } hr { -- 2.39.5