Skip to content

Commit 219690b

Browse files
author
Roland Hedberg
committed
Don't let lower/upper case throw me off.
1 parent d40226c commit 219690b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/saml2/attribute_converter.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,19 @@ def to_format(self, attr):
425425
:return: An Attribute instance
426426
"""
427427
try:
428+
_attr = self._to[attr]
429+
except KeyError:
430+
try:
431+
_attr = self._to[attr.to_lower()]
432+
except:
433+
_attr = ''
434+
435+
if _attr:
428436
return factory(saml.Attribute,
429-
name=self._to[attr],
437+
name=_attr,
430438
name_format=self.name_format,
431439
friendly_name=attr)
432-
except KeyError:
440+
else:
433441
return factory(saml.Attribute, name=attr)
434442

435443
def from_format(self, attr):

src/saml2/entity_category/incommon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
"eduPersonScopedAffiliation", "mail",
99
"givenName", "sn", "displayName"]
1010
}
11-

0 commit comments

Comments
 (0)