0001-user-handle-user.attributes-setter-for-multiple-attr.patch
src/authentic2/custom_user/models.py | ||
---|---|---|
45 | 45 |
def __setattr__(self, name, value): |
46 | 46 |
atv = self.values.get(name) |
47 | 47 |
if atv: |
48 |
atv.attribute.set_value(self.owner, value, verified=bool(self.verified), attribute_value=atv) |
|
48 |
if isinstance(atv, (list, tuple)): |
|
49 |
attribute = atv[0].attribute |
|
50 |
else: |
|
51 |
attribute = atv.attribute |
|
52 |
attribute.set_value(self.owner, value, verified=bool(self.verified), attribute_value=atv) |
|
49 | 53 |
else: |
50 | 54 |
attribute = get_attributes_map().get(name) |
51 | 55 |
if not attribute: |
52 |
- |