From 912f63a970b2db8affe4ae87b6ff0b19fe5caa24 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Thu, 20 Nov 2014 16:50:37 -0800 Subject: [PATCH] fix sliceplus to work with big rename --- planetstack/core/xoslib/objects/sliceplus.py | 2 +- planetstack/core/xoslib/static/js/xoslib/xos-backbone.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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; }; -- 2.43.0