Skip to content

Commit 58181bd

Browse files
author
Roland Hedberg
committed
Allow specifying prefixes for namespaces in the XML that a SAML class instance is serialized to.
1 parent bbe6260 commit 58181bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/saml2/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,12 @@ class SamlBase(ExtensionContainer):
444444
c_children = {}
445445
c_attributes = {}
446446
c_attribute_type = {}
447-
#c_attribute_use = {}
448-
#c_attribute_required = {}
449447
c_child_order = []
450448
c_cardinality = {}
451449
c_any = None
452450
c_any_attribute = None
453451
c_value_type = None
452+
c_ns_prefix = None
454453

455454
def _get_all_c_children_with_order(self):
456455
if len(self.c_child_order) > 0:
@@ -549,6 +548,9 @@ def to_string(self, nspair=None):
549548
constructing the text representation.
550549
:return: String representation of the object
551550
"""
551+
if not nspair and self.c_ns_prefix:
552+
nspair = self.c_ns_prefix
553+
552554
if nspair:
553555
for prefix, uri in nspair.items():
554556
try:

0 commit comments

Comments
 (0)