fix sliceplus to work with big rename
authorScott Baker <smbaker@gmail.com>
Fri, 21 Nov 2014 00:50:37 +0000 (16:50 -0800)
committerScott Baker <smbaker@gmail.com>
Fri, 21 Nov 2014 00:50:37 +0000 (16:50 -0800)
planetstack/core/xoslib/objects/sliceplus.py
planetstack/core/xoslib/static/js/xoslib/xos-backbone.js

index a5d7a7e..6e586d2 100644 (file)
@@ -18,7 +18,7 @@ class SlicePlus(Slice, PlusObjectMixin):
 
         roles = []
         if (user!=None):
-            roles = [x.role for x in self.slice_privileges.filter(user=user)]
+            roles = [x.role for x in self.sliceprivileges.filter(user=user)]
 
         return {"sitesUsed": used_sites,
                 "deploymentsUsed": used_deployments,
index f615c30..bbf13a4 100644 (file)
@@ -264,7 +264,11 @@ if (! window.XOSLIB_LOADED ) {
         modelName = attrs.modelName;
         modelClassName = modelName;
         collectionClassName = modelName + "Collection";
-        collectionName = modelName + "s";
+
+        if (!attrs.collectionName) {
+            attrs.collectionName = modelName + "s";
+        }
+        collectionName = attrs.collectionName;
 
         modelAttrs = {}
         collectionAttrs = {}
@@ -364,7 +368,8 @@ if (! window.XOSLIB_LOADED ) {
         // enhanced REST
         define_model(this, {urlRoot: SLICEPLUS_API,
                             relatedCollections: {'slivers': "slice"},
-                            modelName: "slicePlus"});
+                            modelName: "slicePlus",
+                            collectionName: "slicesPlus"});
 
         this.listObjects = function() { return this.allCollectionNames; };