From 50d9eb1c50e6147e364adbe9e15b42e128f3ad0e Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 23 Dec 2020 11:26:52 +0530 Subject: [PATCH] Fix UnboundLocalError: local variable 'stripe_onetime_charge' referenced before assignment --- datacenterlight/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 3eb77412..a8760290 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -706,6 +706,12 @@ class OrderConfirmationView(DetailView, FormView): return render(request, self.template_name, context) def post(self, request, *args, **kwargs): + stripe_onetime_charge = None + stripe_customer_obj = None + gp_details = None + specs = None + vm_template_id = 0 + template = None user = request.session.get('user') stripe_api_cus_id = request.session.get('customer') stripe_utils = StripeUtils()