Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/core/admin.py b/xos/core/admin.py
index d5246ae..41dfa9b 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -404,8 +404,9 @@
class InstanceInline(XOSTabularInline):
model = Instance
- fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node', 'no_sync']
+ fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node']
extra = 0
+ max_num = 0
readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name']
suit_classes = 'suit-tab suit-tab-instances'
@@ -557,7 +558,8 @@
kwargs['queryset'] = Deployment.select_by_user(request.user)
if db_field.name == 'controller':
- kwargs['queryset'] = Controller.select_by_user(request.user).filter(deployment__id=int(resolve(request.path).args[0]))
+ if len(resolve(request.path).args) > 0:
+ kwargs['queryset'] = Controller.select_by_user(request.user).filter(deployment__id=int(resolve(request.path).args[0]))
return super(SiteDeploymentInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
diff --git a/xos/core/templates/slice_instance_tab.html b/xos/core/templates/slice_instance_tab.html
index f3890c8..d2aa3fc 100644
--- a/xos/core/templates/slice_instance_tab.html
+++ b/xos/core/templates/slice_instance_tab.html
@@ -2,7 +2,7 @@
<a href="/admin/core/instance/add/?_to_field=id&slice={{ slice_id }}" class="add-another" id="add_instance_advanced"
onclick="return showAddInstancePopup(this);">
-Add Instance using expert settings window
+Add Instance
</a>
<!-- div id="instance_advanced" style="display: node;" onchange="console.log('changed');" -->
<input type="hidden" id="instance_advanced" name="instance_advanced" onchange="console.log('changed');" value="initial">
@@ -38,4 +38,8 @@
</script>
+{% else %}
+
+Please save this slice before adding Instances.
+
{% endif %}