X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FKeyTypes.py;h=1fae01b07c5ae73b06b627aab04b6732a65540ce;hb=ae247e567468efe3fd5e54488a6fdd32da11fa96;hp=34df0196e4cbaba71ecf95b332f9cdf13104a4ba;hpb=a74854dd38cb742b8fdc0d0cda7fff738a95312c;p=plcapi.git diff --git a/PLC/KeyTypes.py b/PLC/KeyTypes.py index 34df019..1fae01b 100644 --- a/PLC/KeyTypes.py +++ b/PLC/KeyTypes.py @@ -5,6 +5,7 @@ # Copyright (C) 2006 The Trustees of Princeton University # # $Id$ +# $URL$ # from PLC.Faults import * @@ -25,17 +26,17 @@ class KeyType(Row): } def validate_key_type(self, name): - # Make sure name is not blank + # Make sure name is not blank if not len(name): raise PLCInvalidArgument, "Key type must be specified" - - # Make sure key type does not alredy exist - conflicts = KeyTypes(self.api, [name]) + + # Make sure key type does not alredy exist + conflicts = KeyTypes(self.api, [name]) if conflicts: raise PLCInvalidArgument, "Key type name already in use" - return name - + return name + class KeyTypes(Table): """ Representation of the key_types table in the database. @@ -46,7 +47,7 @@ class KeyTypes(Table): sql = "SELECT %s FROM key_types" % \ ", ".join(KeyType.fields) - + if key_types: sql += " WHERE key_type IN (%s)" % ", ".join(map(api.db.quote, key_types))