From a3a8227007ac517a08fe856bc4a038d9e016e4f7 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 19 Apr 2018 01:08:52 +0200 Subject: [PATCH] Check if subscription metadata update response does not have errors --- datacenterlight/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 758778b6..12fabc1e 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -106,8 +106,8 @@ def create_vm_task(self, vm_template_id, user, specs, template, order_id): subscription_id=hosting_order.subscription_id, metadata={"VM_ID": str(vm_id)} ) - stripe_subscription_obj = result.get('response_object') - if stripe_subscription_obj is not None: + + if result.get('error') is not None: emsg = "Could not update subscription metadata for {sub}".format( sub=hosting_order.subscription_id )