Added condition that the status should be 'active' for new subscription

This commit is contained in:
M.Ravi 2017-08-17 18:31:27 +02:00
parent 171a463261
commit fcaa5e31dd

View file

@ -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)