From dad4f42dc3b73c9a4cc3385b147507a79d6ddfc3 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 20 Apr 2019 19:13:34 +0200 Subject: [PATCH] Do not add vm_conf to details if it is None --- hosting/models.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hosting/models.py b/hosting/models.py index 19e73cca..7b7a7792 100644 --- a/hosting/models.py +++ b/hosting/models.py @@ -513,10 +513,12 @@ class HostingBillLineItem(AssignPermissionsMixin, models.Model): vm_conf = StripeUtils.get_vm_config_from_stripe_id( self.stripe_plan.stripe_plan_id ) - item_detail += ("Cores: {}
RAM: {} GB
" - "SSD: {} GB
").format( - vm_conf['cores'], int(float(vm_conf['ram'])), vm_conf['ssd'] - ) + if vm_conf is not None: + item_detail += ("Cores: {}
RAM: {} GB
" + "SSD: {} GB
").format( + vm_conf['cores'], int(float(vm_conf['ram'])), + vm_conf['ssd'] + ) return item_detail class VMDetail(models.Model):