get rid of svn keywords once and for good
[plcapi.git] / PLC / Methods / AddSession.py
index 06f43af..32da201 100644 (file)
@@ -1,4 +1,3 @@
-# $Id#
 import time
 
 from PLC.Method import Method
@@ -9,30 +8,30 @@ from PLC.Persons import Person, Persons
 
 class AddSession(Method):
     """
-    Creates and returns a new session key for the specified user. 
+    Creates and returns a new session key for the specified user.
     (Used for website 'user sudo')
     """
 
     roles = ['admin']
     accepts = [
-       Auth(),
-       Mixed(Person.fields['person_id'],
+        Auth(),
+        Mixed(Person.fields['person_id'],
               Person.fields['email'])
-       ]
+        ]
     returns = Session.fields['session_id']
-    
+
 
     def call(self, auth, person_id_or_email):
-        
-       persons = Persons(self.api, [person_id_or_email], ['person_id', 'email'])
-       
-       if not persons:
-           raise PLCInvalidArgument, "No such person"
-       
-       person = persons[0]
-       session = Session(self.api)
+
+        persons = Persons(self.api, [person_id_or_email], ['person_id', 'email'])
+
+        if not persons:
+            raise PLCInvalidArgument, "No such person"
+
+        person = persons[0]
+        session = Session(self.api)
         session['expires'] = int(time.time()) + (24 * 60 * 60)
-       session.sync(commit = False)
-       session.add_person(person, commit = True)
+        session.sync(commit = False)
+        session.add_person(person, commit = True)
 
         return session['session_id']