X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FAddAddressType.py;h=0dcc66dd6b227bac2767d7a05331439c6f5d2714;hb=2197504226e266858256a5ae69bd8d8d8b886de2;hp=904a432babf97fdd152bdc64c8a69a6760feaa65;hpb=7e7751b60ad5379a11bb78e571bad3df9f5eb02f;p=plcapi.git diff --git a/PLC/Methods/AddAddressType.py b/PLC/Methods/AddAddressType.py index 904a432..0dcc66d 100644 --- a/PLC/Methods/AddAddressType.py +++ b/PLC/Methods/AddAddressType.py @@ -2,7 +2,7 @@ from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.AddressTypes import AddressType, AddressTypes -from PLC.Auth import PasswordAuth +from PLC.Auth import Auth can_update = lambda (field, value): field not in ['address_type_id'] @@ -19,15 +19,12 @@ class AddAddressType(Method): address_type_fields = dict(filter(can_update, AddressType.fields.items())) accepts = [ - PasswordAuth(), + Auth(), address_type_fields ] returns = Parameter(int, 'New address_type_id (> 0) if successful') - event_type = 'Add' - object_type = 'AddressType' - object_ids = [] def call(self, auth, address_type_fields): address_type_fields = dict(filter(can_update, address_type_fields.items()))