owners for multi options
authorgwen <gremond@cadoles.com>
Tue, 11 Dec 2012 15:22:02 +0000 (16:22 +0100)
committergwen <gremond@cadoles.com>
Tue, 11 Dec 2012 15:22:02 +0000 (16:22 +0100)
tiramisu/option.py

index 9dea2e9..acb9620 100644 (file)
@@ -99,15 +99,15 @@ class Multi(list):
             if not self.opt._validate(value):
                 raise ConfigError("invalid value {0} "
                     "for option {1}".format(str(value), self.opt._name))
-        if not isinstance(who, owners.Owner):
-            raise TypeError("invalid owner {0} for the value {1}".format(
-                            str(who), str(value)))
         oldvalue = list(self)
         if key is None:
             ret = super(Multi, self).append(value)
         else:
             ret = super(Multi, self).__setitem__(key, value)
         if who != None:
+            if not isinstance(who, owners.Owner):
+                raise TypeError("invalid owner {0} for the value {1}".format(
+                                str(who), str(value)))
             self.opt.setowner(self.config, getattr(owners, who))
         self.config._cfgimpl_previous_values[self.opt._name] = oldvalue
         return ret