diff options
author | Andrea Biancini <andrea.biancini@gmail.com> | 2015-02-27 13:52:55 +0100 |
---|---|---|
committer | Andrea Biancini <andrea.biancini@gmail.com> | 2015-02-27 13:52:55 +0100 |
commit | a51eee702ad1c584187bba3ee456e29eed987743 (patch) | |
tree | f396eab77780414768b2cd3e30259be4ced677e8 | |
parent | 7b025c619ffd187ededb102143eaf6a6c87ee918 (diff) | |
download | pysaml2-a51eee702ad1c584187bba3ee456e29eed987743.tar.gz |
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.
-rw-r--r-- | src/saml2/s_utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/saml2/s_utils.py b/src/saml2/s_utils.py index e17c2b56..16d031f6 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: |