print "-"*80
result = manifold_api.forward(query.to_dict())
if result['code'] == 2:
+ # this is gross; at the very least we need to logout()
+ # but most importantly there is a need to refine that test, since
+ # code==2 does not necessarily mean an expired session
# XXX only if we know it is the issue
del request.session['manifold']
- raise Exception, 'Error running query: %r' % result
+ # Flush django session
+ request.session.flush()
+ #raise Exception, 'Error running query: %r' % result
if result['code'] == 1:
print "WARNING"
def execute_query(request, query):
if not 'manifold' in request.session or not 'auth' in request.session['manifold']:
+ request.session.flush()
raise Exception, "User not authenticated"
manifold_api_session_auth = request.session['manifold']['auth']
return _execute_query(request, query, manifold_api_session_auth)