diff options
author | Rebecka Gulliksson <rebecka.gulliksson@umu.se> | 2016-09-26 09:37:19 +0200 |
---|---|---|
committer | Rebecka Gulliksson <rebecka.gulliksson@umu.se> | 2016-09-27 08:49:00 +0200 |
commit | 9c416a03ca9c5dc36101e7b8d36bf48ee8d6391c (patch) | |
tree | bbb6b7aa65b967249e2ecfb87171dd4a13bdcc40 /src/saml2/attribute_converter.py | |
parent | 17e6883bd76d90f572430228d98d87dd3b0a216f (diff) | |
download | pysaml2-9c416a03ca9c5dc36101e7b8d36bf48ee8d6391c.tar.gz |
Flatten eduPersonTargetedID when converting it.
Diffstat (limited to 'src/saml2/attribute_converter.py')
-rw-r--r-- | src/saml2/attribute_converter.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/saml2/attribute_converter.py b/src/saml2/attribute_converter.py index 85ec26c8..94031fb3 100644 --- a/src/saml2/attribute_converter.py +++ b/src/saml2/attribute_converter.py @@ -377,14 +377,17 @@ class AttributeConverter(object): ext = extension_elements_to_elements(value.extension_elements, [saml]) for ex in ext: - cval = {} - for key, (name, typ, mul) in ex.c_attributes.items(): - exv = getattr(ex, name) - if exv: - cval[name] = exv - if ex.text: - cval["value"] = ex.text.strip() - val.append({ex.c_tag: cval}) + if attr == "eduPersonTargetedID" and ex.text: + val.append(ex.text.strip()) + else: + cval = {} + for key, (name, typ, mul) in ex.c_attributes.items(): + exv = getattr(ex, name) + if exv: + cval[name] = exv + if ex.text: + cval["value"] = ex.text.strip() + val.append({ex.c_tag: cval}) elif not value.text: val.append('') else: |