From f1df689da513b1523ce89f0ba32728592999c1f2 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Fri, 23 Aug 2013 11:06:48 +0200 Subject: [PATCH] platforms page has only enabled platforms, manifoldproxy modified to use admin connexion when from = local:platform & action = get --- manifold/manifoldproxy.py | 2 +- myslice/viewutils.py | 3 +-- portal/views.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/manifold/manifoldproxy.py b/manifold/manifoldproxy.py index f6ceb0ef..720e5646 100644 --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -56,7 +56,7 @@ with the query passed using POST""" # retrieve session for request # We allow some requests to use the ADMIN user account - if manifold_query.get_from() == 'local:user' and manifold_query.get_action() == 'create': + if (manifold_query.get_from() == 'local:user' and manifold_query.get_action() == 'create') or (manifold_query.get_from() == 'local:platform' and manifold_query.get_action() == 'get'): print "W: Used hardcoded demo account for admin queries" manifold_api_session_auth = {'AuthMethod': 'password', 'Username': 'demo', 'AuthString': 'demo'} else: diff --git a/myslice/viewutils.py b/myslice/viewutils.py index 9be8941a..c6067f28 100644 --- a/myslice/viewutils.py +++ b/myslice/viewutils.py @@ -20,13 +20,12 @@ def topmenu_items (current,request=None): result=deepcopy(standard_topmenu_items) result.append({'label':'My Account', 'href': '/portal/account/'}) result.append({ 'label':'Request a slice', 'href': '/portal/slice_request/'}) - result.append({'label':'Contact Support', 'href': '/portal/contact/'}) else: result = [] result.append({'label':'Home', 'href': '/login'}) result.append({ 'label':'Register', 'href': '/portal/user/register/'}) - result.append({'label':'Contact Support', 'href': '/portal/contact/'}) result.append({'label':'Platforms', 'href': '/portal/platforms/'}) + result.append({'label':'Contact Support', 'href': '/portal/contact/'}) for d in result: #if d['label'].lower()find(current)>=0: d['is_active']=True if d['label'] == current: d['is_active']=True diff --git a/portal/views.py b/portal/views.py index 5b800167..20710f4c 100644 --- a/portal/views.py +++ b/portal/views.py @@ -486,7 +486,7 @@ class PlatformsView(TemplateView): def get_context_data(self, **kwargs): page = Page(self.request) - network_query = Query().get('local:platform').select('platform','platform_longname','gateway_type') + network_query = Query().get('local:platform').filter_by('disabled', '==', '0').select('platform','platform_longname','gateway_type') page.enqueue_query(network_query) page.expose_js_metadata() -- 2.43.0