From a51eee702ad1c584187bba3ee456e29eed987743 Mon Sep 17 00:00:00 2001 From: Andrea Biancini Date: Fri, 27 Feb 2015 13:52:55 +0100 Subject: [PATCH] Fixed problem with metadata extensions With this small modification, I fixed I problem I was experiencing while trying to add RequestInitiator extension to a SP metadata. The problem here is that the XML attributes are called Binding and Location while the python instance attributes are called binding and location respectively. Se the instruction "elif key in _inst.c_attributes:" needs to have key with the capital letter while the setattr needs the lowercase name of the field. To be more generic I imagined it was better to retrieve the field name from the tuple associated to the field in c_attributes. --- src/saml2/s_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/saml2/s_utils.py b/src/saml2/s_utils.py index e17c2b5..16d031f 100644 --- a/src/saml2/s_utils.py +++ b/src/saml2/s_utils.py @@ -469,7 +469,7 @@ def rec_factory(cls, **kwargs): except Exception: continue else: - setattr(_inst, key, val) + setattr(_inst, _inst.c_attributes[key][0], val) elif key in _inst.c_child_order: for tag, _cls in _inst.c_children.values(): if tag == key: