From bf96c83b2da7b9046495783510dc76a320a229cd Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Mon, 29 May 2017 17:35:03 +0200 Subject: [PATCH] fix for bad xsi:nil on complex attributevalue --- src/saml2/saml.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/saml2/saml.py b/src/saml2/saml.py index 35b7bd1..c53aab9 100644 --- a/src/saml2/saml.py +++ b/src/saml2/saml.py @@ -139,10 +139,12 @@ class AttributeValueBase(SamlBase): if self._extatt: self.extension_attributes = self._extatt - if not text: - self.extension_attributes = {XSI_NIL: 'true'} - else: + if text: self.set_text(text) + elif not extension_elements: + self.extension_attributes = {XSI_NIL: 'true'} + elif XSI_TYPE in self.extension_attributes: + del self.extension_attributes[XSI_TYPE] def __setattr__(self, key, value): if key == "text":