git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d947b2
)
more tenantview variables pass to xoslib
author
Scott Baker
<smbaker@gmail.com>
Mon, 12 Jan 2015 20:57:44 +0000
(12:57 -0800)
committer
Scott Baker
<smbaker@gmail.com>
Mon, 12 Jan 2015 20:57:44 +0000
(12:57 -0800)
planetstack/core/xoslib/methods/tenantview.py
patch
|
blob
|
history
diff --git
a/planetstack/core/xoslib/methods/tenantview.py
b/planetstack/core/xoslib/methods/tenantview.py
index
c7ce500
..
dbf6ddc
100644
(file)
--- a/
planetstack/core/xoslib/methods/tenantview.py
+++ b/
planetstack/core/xoslib/methods/tenantview.py
@@
-13,8
+13,7
@@
from syndicate_storage.models import Volume
BLESSED_DEPLOYMENTS = ["ViCCI"] # ["US-MaxPlanck", "US-GeorgiaTech", "US-Princeton", "US-Washington", "US-Stanford"]
BLESSED_DEPLOYMENTS = ["ViCCI"] # ["US-MaxPlanck", "US-GeorgiaTech", "US-Princeton", "US-Washington", "US-Stanford"]
-
-def getTenantViewDict():
+def getTenantViewDict(user):
blessed_sites = []
for site in Site.objects.all():
good=False
blessed_sites = []
for site in Site.objects.all():
good=False
@@
-46,6
+45,8
@@
def getTenantViewDict():
"blessed_images": [image.id for image in blessed_images],
"public_volume_names": [volume.name for volume in volumes],
"public_volumes": [volume.id for volume in volumes],
"blessed_images": [image.id for image in blessed_images],
"public_volume_names": [volume.name for volume in volumes],
"public_volumes": [volume.id for volume in volumes],
+ "current_user_site_id": user.site.id,
+ "current_user_login_base": user.site.login_base,
}
class TenantList(APIView):
}
class TenantList(APIView):
@@
-53,12
+54,12
@@
class TenantList(APIView):
method_name = "tenantview"
def get(self, request, format=None):
method_name = "tenantview"
def get(self, request, format=None):
- return Response( getTenantViewDict() )
+ return Response( getTenantViewDict(
request.user
) )
class TenantDetail(APIView):
method_kind = "detail"
method_name = "tenantview"
def get(self, request, format=None, pk=0):
class TenantDetail(APIView):
method_kind = "detail"
method_name = "tenantview"
def get(self, request, format=None, pk=0):
- return Response( [getTenantViewDict()] )
+ return Response( [getTenantViewDict(
request.user
)] )