platforms page has only enabled platforms, manifoldproxy modified to use admin connex...
authorLoic Baron <loic.baron@lip6.fr>
Fri, 23 Aug 2013 09:06:48 +0000 (11:06 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 23 Aug 2013 09:06:48 +0000 (11:06 +0200)
manifold/manifoldproxy.py
myslice/viewutils.py
portal/views.py

index f6ceb0e..720e564 100644 (file)
@@ -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:
index 9be8941..c6067f2 100644 (file)
@@ -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
index 5b80016..20710f4 100644 (file)
@@ -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()