return status text in json for tenant views
Scott Baker [Mon, 2 Jun 2014 03:45:13 +0000 (20:45 -0700)]
planetstack/core/dashboard/views/tenant.py

index a541ed9..9066a2b 100644 (file)
@@ -31,7 +31,7 @@ class TenantCreateSlice(View):
           addOrModifyPorts(networkPorts,sliceName)\r
           if privateVolume=="true":\r
                privateVolForSlice(request.user,sliceName)
-        return HttpResponse("Slice created")
+        return HttpResponse(json.dumps("Slice created"), mimetype='application/javascript')
 
 def privateVolForSlice(user,sliceName):
        if not hasPrivateVolume(sliceName):\r
@@ -64,7 +64,7 @@ class TenantUpdateSlice(View):
        addOrModifyPorts(networkPorts,sliceName)\r
        if privateVolume=="true":\r
                 privateVolForSlice(request.user,sliceName)\r
-        return HttpResponse("Slice updated")\r
+        return HttpResponse(json.dumps("Slice updated"), mimetype='application/javascript')\r
 \r
 def addNetwork(name,template,sliceName):\r
        networkTemplate=NetworkTemplate.objects.get(name=template)\r
@@ -237,7 +237,7 @@ class TenantDeleteSliceView(View):
                 #print slice, slice.id\r
                 sliceToDel=Slice(name=sliceName, id=slice.id)\r
                 sliceToDel.delete()
-                return HttpResponse("Slice deleted")
+                return HttpResponse(json.dumps("Slice deleted"), mimetype='application/javascript')
 
 class TenantAddOrRemoveSliverView(View):
     """ Add or remove slivers from a Slice