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

This commit is contained in:
Roland Hedberg
2010-03-11 09:55:45 +01:00
parent 598fcebbce
commit a9135499bd

View File

@@ -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 = """<tr><td>%s</td><td>%s</td></tr>"""