Skip to content

Commit a51eee7

Browse files
committed
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.
1 parent 7b025c6 commit a51eee7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/saml2/s_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def rec_factory(cls, **kwargs):
469469
except Exception:
470470
continue
471471
else:
472-
setattr(_inst, key, val)
472+
setattr(_inst, _inst.c_attributes[key][0], val)
473473
elif key in _inst.c_child_order:
474474
for tag, _cls in _inst.c_children.values():
475475
if tag == key:

0 commit comments

Comments
 (0)