X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddPCUType.py;h=4b4bf65b725418456a7f50d5d6c06935da4e8a55;hb=3b44c0228c26dc43d985185afc225caa5f48c1fb;hp=2c8fbe5495c11ab493fcf13bce92c02642152bbe;hpb=997c5bbe5b0576ae8c9c8d52a80dab1dcecf615a;p=plcapi.git diff --git a/PLC/Methods/AddPCUType.py b/PLC/Methods/AddPCUType.py index 2c8fbe5..4b4bf65 100644 --- a/PLC/Methods/AddPCUType.py +++ b/PLC/Methods/AddPCUType.py @@ -4,7 +4,7 @@ from PLC.Parameter import Parameter, Mixed from PLC.PCUTypes import PCUType, PCUTypes from PLC.Auth import Auth -can_update = lambda (field, value): field in \ +can_update = lambda field_value: field_value[0] in \ ['model', 'name'] class AddPCUType(Method): @@ -16,7 +16,7 @@ class AddPCUType(Method): roles = ['admin'] - pcu_type_fields = dict(filter(can_update, PCUType.fields.items())) + pcu_type_fields = dict(list(filter(can_update, list(PCUType.fields.items())))) accepts = [ Auth(), @@ -27,7 +27,7 @@ class AddPCUType(Method): def call(self, auth, pcu_type_fields): - pcu_type_fields = dict(filter(can_update, pcu_type_fields.items())) + pcu_type_fields = dict(list(filter(can_update, list(pcu_type_fields.items())))) pcu_type = PCUType(self.api, pcu_type_fields) pcu_type.sync() self.event_object = {'PCUType': [pcu_type['pcu_type_id']]}