user: handle user.attributes setter for multiple attributes (#32025)

This commit is contained in:
Paul Marillonnet 2019-04-05 15:37:23 +02:00
parent da5e603008
commit 653e824804
1 changed files with 5 additions and 1 deletions

View File

@ -61,7 +61,11 @@ class Attributes(object):
def __setattr__(self, name, value):
atv = self.values.get(name)
if atv:
atv.attribute.set_value(self.owner, value, verified=bool(self.verified), attribute_value=atv)
if isinstance(atv, (list, tuple)):
attribute = atv[0].attribute
else:
attribute = atv.attribute
attribute.set_value(self.owner, value, verified=bool(self.verified), attribute_value=atv)
else:
attribute = get_attributes_map().get(name)
if not attribute: