X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=auth%2Fmanifoldbackend.py;h=529ef0fcf5a694029fad881122293eda1f67ab11;hb=f71f48bbebffa6bb81165a9e6acaa872181a8926;hp=c58c09ebeb655558926b2f70d3147aba74445d0f;hpb=d0ac1170425c64337c521b673b88d75425b8adba;p=myslice.git diff --git a/auth/manifoldbackend.py b/auth/manifoldbackend.py index c58c09eb..529ef0fc 100644 --- a/auth/manifoldbackend.py +++ b/auth/manifoldbackend.py @@ -21,25 +21,14 @@ class ManifoldBackend: auth = {'AuthMethod': 'password', 'Username': username, 'AuthString': password} api = ManifoldAPI(auth) -#old # Authenticate user and get session key -#old # the new API would expect Get('local:session') instead -#old session_result = api.GetSession() -#old session = session_result.ok_value() -#old if not session: -#old print "GetSession failed",session_result.error() -#old return -#old print 'DEALING with session',session -#old #self.session = session -#old # Change GetSession() at some point to return expires as well -#old expires = time.time() + (24 * 60 * 60) - sessions_result = api.forward(Query.create('local:session').to_dict()) print "result" sessions = sessions_result.ok_value() print "ok" if not sessions: print "GetSession failed", sessions_result.error() - print "first" + return + print "first", sessions session = sessions[0] print "SESSION=", session @@ -60,6 +49,8 @@ class ManifoldBackend: request.session['manifold'] = {'auth': api.auth, 'person': person, 'expires': session['expires']} except Exception, e: print "E: manifoldbackend", e + import traceback + traceback.print_exc() return None try: