resolve some oddities with HPC admin failing to add services
diff --git a/xos/services/hpc/admin.py b/xos/services/hpc/admin.py
index 233668b..d9f28c6 100644
--- a/xos/services/hpc/admin.py
+++ b/xos/services/hpc/admin.py
@@ -25,7 +25,8 @@
def __init__(self, *args, **kwargs):
super(HpcServiceForm, self).__init__(*args, **kwargs)
- self.fields['scale'].initial = kwargs["instance"].scale
+ if ("instance" in kwargs) and (hasattr(kwargs["instance"], "scale")):
+ self.fields['scale'].initial = kwargs["instance"].scale
def save(self, *args, **kwargs):
if self.cleaned_data['scale']: