Merge branch 'master' of ssh://git.planet-lab.org/git/plstackapi
[plstackapi.git] / planetstack / core / admin.py
index 86b2b3c..dddebbf 100644 (file)
@@ -239,7 +239,7 @@ class SliverInline(PlStackTabularInline):
            #     then find the child with class "field-node"
            #     then find the child with that is a select
            #     then return its id
-           kwargs['widget'] = forms.Select(attrs={'onChange': "update_nodes(this, $($($(this).closest('tr')[0]).children('.field-node')[0]).children('select')[0].id);"})
+           kwargs['widget'] = forms.Select(attrs={'onChange': "update_nodes(this, $($(this).closest('tr')[0]).find('.field-node select')[0].id)"})
            #kwargs['widget'] = forms.Select(attrs={'onChange': "console.log($($($(this).closest('tr')[0]).children('.field-node')[0]).children('select')[0].id);"})
 
         field = super(SliverInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
@@ -826,14 +826,14 @@ class SlicePrivilegeAdmin(PlanetStackBaseAdmin):
     def save_model(self, request, obj, form, change):
         # update openstack connection to use this site/tenant
         auth = request.session.get('auth', {})
-        auth['tenant'] = obj.slice.name
+        auth['tenant'] = obj.slice.slicename
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.save()
 
     def delete_model(self, request, obj):
         # update openstack connection to use this site/tenant
         auth = request.session.get('auth', {})
-        auth['tenant'] = obj.slice.name
+        auth['tenant'] = obj.slice.slicename
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.delete()