From: Scott Baker Date: Fri, 21 Nov 2014 00:50:37 +0000 (-0800) Subject: fix sliceplus to work with big rename X-Git-Url: http://git.onelab.eu/?p=plstackapi.git;a=commitdiff_plain;h=912f63a970b2db8affe4ae87b6ff0b19fe5caa24 fix sliceplus to work with big rename --- diff --git a/planetstack/core/xoslib/objects/sliceplus.py b/planetstack/core/xoslib/objects/sliceplus.py index a5d7a7e..6e586d2 100644 --- a/planetstack/core/xoslib/objects/sliceplus.py +++ b/planetstack/core/xoslib/objects/sliceplus.py @@ -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, diff --git a/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js b/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js index f615c30..bbf13a4 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js +++ b/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js @@ -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; };