From: parmentelat Date: Thu, 20 Dec 2018 11:31:52 +0000 (+0100) Subject: cosmetic pep8-like X-Git-Tag: plcapi-7.0-0~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c7b7ecd315043f172b23cb50fd99916123eb859d;hp=d51a2803a4fb08e542e2debb4b49983066e5aaf4;p=plcapi.git cosmetic pep8-like --- 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']