X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifold%2Fmanifoldapi.py;h=6639d484cf2ed6bfe96cd5dc53bfd325b34adecf;hb=9644d2a6bc4e9a32a0be1779180ce0830cbecf91;hp=25b80f9cf96301675f3fb1518d6b9e5571346276;hpb=13fe73170b3a3f5912bbd13aee0a97048d935436;p=myslice.git diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index 25b80f9c..6639d484 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -135,8 +135,11 @@ def _execute_query(request, query, manifold_api_session_auth): # 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 - # del request.session['manifold'] - raise Exception, 'Error running query: %r' % result + # XXX only if we know it is the issue + del request.session['manifold'] + # Flush django session + request.session.flush() + #raise Exception, 'Error running query: %r' % result if result['code'] == 1: print "WARNING" @@ -149,6 +152,7 @@ def _execute_query(request, query, manifold_api_session_auth): 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)