X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetSession.py;fp=PLC%2FMethods%2FGetSession.py;h=8ae8dd1b631fab4261c165c08f32f0e77f2946ba;hb=c7b7ecd315043f172b23cb50fd99916123eb859d;hp=1e05765c4d6b16bdcab2cb134dcbdf2c8db31ad7;hpb=d51a2803a4fb08e542e2debb4b49983066e5aaf4;p=plcapi.git diff --git a/PLC/Methods/GetSession.py b/PLC/Methods/GetSession.py index 1e05765..8ae8dd1 100644 --- a/PLC/Methods/GetSession.py +++ b/PLC/Methods/GetSession.py @@ -12,13 +12,13 @@ class GetSession(Method): Returns a new session key if a user or node authenticated successfully, faults otherwise. - Default value for 'expires' is 24 hours. Otherwise, the returned + Default value for 'expires' is 24 hours. Otherwise, the returned session 'expires' in the given number of seconds. """ roles = ['admin', 'pi', 'user', 'tech', 'node'] accepts = [Auth(), - Parameter(int,"expires", nullok=True)] + Parameter(int, "expires", nullok=True)] returns = Session.fields['session_id'] @@ -36,11 +36,11 @@ class GetSession(Method): else: session['expires'] = int(time.time()) + int(expires) - session.sync(commit = False) + session.sync(commit=False) if isinstance(self.caller, Node): - session.add_node(self.caller, commit = True) + session.add_node(self.caller, commit=True) elif isinstance(self.caller, Person): - session.add_person(self.caller, commit = True) + session.add_person(self.caller, commit=True) return session['session_id']