diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2015-11-16 21:12:41 +0100 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2015-11-16 21:12:41 +0100 |
commit | 219690b6eb2dc6afc86ca9313f5e4f47433bcb2c (patch) | |
tree | 31167eed55cedc5bec7c808f738c429b2b2d4b6b /src/saml2 | |
parent | d40226cf0d35d0ef6cbae3c8f367154efdb713eb (diff) | |
download | pysaml2-219690b6eb2dc6afc86ca9313f5e4f47433bcb2c.tar.gz |
Don't let lower/upper case throw me off.
Diffstat (limited to 'src/saml2')
-rw-r--r-- | src/saml2/attribute_converter.py | 12 | ||||
-rw-r--r-- | src/saml2/entity_category/incommon.py | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/saml2/attribute_converter.py b/src/saml2/attribute_converter.py index 5a1b3715..c0aaf332 100644 --- a/src/saml2/attribute_converter.py +++ b/src/saml2/attribute_converter.py @@ -425,11 +425,19 @@ class AttributeConverter(object): :return: An Attribute instance """ try: + _attr = self._to[attr] + except KeyError: + try: + _attr = self._to[attr.to_lower()] + except: + _attr = '' + + if _attr: return factory(saml.Attribute, - name=self._to[attr], + name=_attr, name_format=self.name_format, friendly_name=attr) - except KeyError: + else: return factory(saml.Attribute, name=attr) def from_format(self, attr): diff --git a/src/saml2/entity_category/incommon.py b/src/saml2/entity_category/incommon.py index e1c1462b..9df7730b 100644 --- a/src/saml2/entity_category/incommon.py +++ b/src/saml2/entity_category/incommon.py @@ -8,4 +8,3 @@ RELEASE = { "eduPersonScopedAffiliation", "mail", "givenName", "sn", "displayName"] } - |