From fcaa5e31dd80f250adafede561e9dcafe259e6b7 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 17 Aug 2017 18:31:27 +0200 Subject: [PATCH] Added condition that the status should be 'active' for new subscription --- datacenterlight/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 39bda8bb..0fa7e81b 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -481,14 +481,13 @@ class OrderConfirmationView(DetailView): [{"plan": stripe_plan.get( 'response_object').stripe_plan_id}]) response_object = subscription_result.get('response_object') - if response_object is None: + if response_object is None or response_object.status is not 'active': context = {} context.update({ 'paymentError': response_object.get('error') }) return render(request, self.payment_template_name, context) - # Create OpenNebulaManager manager = OpenNebulaManager(email=settings.OPENNEBULA_USERNAME, password=settings.OPENNEBULA_PASSWORD)