+
+ # 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"
+ return HttpResponse (json_answer, mimetype="application/json")
+ ### patch : return the latest one..
+ if work_offline:
+ # if that won't work then we'll try to update anyways
+ try:
+ with (file(offline_filename,"r")) as f:
+ json_answer=f.read()
+ print "By-passing : using contents from %s"%offline_filename
+ return HttpResponse (json_answer, mimetype="application/json")
+ except:
+ import traceback
+ traceback.print_exc()
+ print "Could not run in offline mode, PROCEEDING"
+ pass
+