From a9135499bdb5d380fb5bb612fe7cb42436ad6fe4 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Thu, 11 Mar 2010 09:55:45 +0100 Subject: [PATCH] well-formed but empty attributes were causing an exception to be thrown. For example, my application has a few attributes that are required and a few that are not, eg, first_name. When first_name attr is empty, we use an empty string instead of exploding. -onceuponapriori --- src/saml2/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/saml2/client.py b/src/saml2/client.py index ae4f355..77ec09c 100644 --- a/src/saml2/client.py +++ b/src/saml2/client.py @@ -614,7 +614,10 @@ def get_attribute_values(attribute_statement): name = attribute.name.strip() result[name] = [] for value in attribute.attribute_value: - result[name].append(value.text.strip()) + if not value.text: + result[name].append('') + else: + result[name].append(value.text.strip()) return result ROW = """%s%s"""