X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fmanifoldproxy.py;h=a8bec58906e344c3073bd86685208924d955ca62;hb=07411e389a9d39ddccfd93cd53ac895393a8ae3a;hp=99de7849f4113a8bd6fc5b8c74b6be54e1a666ea;hpb=d0ac1170425c64337c521b673b88d75425b8adba;p=myslice.git diff --git a/manifold/manifoldproxy.py b/manifold/manifoldproxy.py index 99de7849..a8bec589 100644 --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -53,7 +53,14 @@ with the query passed using POST""" manifold_query.fill_from_POST(request.POST) offline_filename="offline-%s-%s.json"%(manifold_query.action,manifold_query.object) # retrieve session for request - manifold_api_session_auth = request.session['manifold']['auth'] + + # We allow some requests to use the ADMIN user account + if manifold_query.get_from() == 'local:user' and manifold_query.get_action() == 'create': + print "W: Used hardcoded demo account for admin queries" + manifold_api_session_auth = {'AuthMethod': 'password', 'Username': 'demo', 'AuthString': 'demo'} + else: + manifold_api_session_auth = request.session['manifold']['auth'] + if debug_empty and manifold_query.action.lower()=='get': json_answer=json.dumps({'code':0,'value':[]}) print "By-passing : debug_empty & 'get' request : returning a fake empty list" @@ -80,6 +87,7 @@ with the query passed using POST""" try: answer=manifold_api.send_manifold_query (manifold_query) except ManifoldException, manifold_result: + print "MANIFOLD EXCEPTION" answer=manifold_result print "="*80 print "ANSWER IN PROXY", answer