GetBootMedium: split former option systemd-debug in 2 parts: systemd-console and...
[plcapi.git] / PLC / Methods / GetPCUs.py
index ee9ab4d..c59fa40 100644 (file)
@@ -32,7 +32,7 @@ class GetPCUs(Method):
     returns = [PCU.fields]
 
     def call(self, auth, pcu_filter = None, return_fields = None):
-       # If we are not admin
+        # If we are not admin
         if not (isinstance(self.caller, Person) and 'admin' in self.caller['roles']):
             # Return only the PCUs at our site
             valid_pcu_ids = []
@@ -62,12 +62,12 @@ class GetPCUs(Method):
 
         # Filter out PCUs that are not viewable
         if not (isinstance(self.caller, Person) and 'admin' in self.caller['roles']):
-            pcus = filter(lambda pcu: pcu['pcu_id'] in valid_pcu_ids, pcus)
+            pcus = [pcu for pcu in pcus if pcu['pcu_id'] in valid_pcu_ids]
 
         # Remove pcu_id if not specified
         if added_fields:
             for pcu in pcus:
-               if 'pcu_id' in pcu:
-                   del pcu['pcu_id']
+                if 'pcu_id' in pcu:
+                    del pcu['pcu_id']
 
         return pcus