From 4be27962703cdb2774e1b0d13842ba3df3b22846 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 29 Oct 2017 22:40:21 +0100 Subject: [PATCH] Clean up some unnecessary code --- datacenterlight/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 3a8bdac6..fb34f5b4 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -348,10 +348,9 @@ class PaymentOrderView(FormView): def get_context_data(self, **kwargs): context = super(PaymentOrderView, self).get_context_data(**kwargs) user = self.request.user + stripe_customer = None if hasattr(user, 'stripecustomer'): stripe_customer = user.stripecustomer - else: - stripe_customer = None cards_list = UserCardDetail.get_all_cards_list( stripe_customer=stripe_customer ) @@ -390,8 +389,6 @@ class PaymentOrderView(FormView): request.session, ['token', 'card_id', 'customer', 'user'] ) - if 'token' in request.session: - del request.session['token'] return self.render_to_response(self.get_context_data()) def post(self, request, *args, **kwargs):