Fix Unset attributes serialisation
This commit is contained in:
parent
6ead929ca4
commit
eaa46bdd34
@ -58,8 +58,10 @@ def toxml(datatype, key, value):
|
||||
key, datatype.tobasetype(value))
|
||||
elif wsme.types.iscomplex(datatype):
|
||||
for attrdef in datatype._wsme_attributes:
|
||||
el.append(toxml(attrdef.datatype, attrdef.name,
|
||||
getattr(value, attrdef.key)))
|
||||
attrvalue = getattr(value, attrdef.key)
|
||||
if attrvalue is not wsme.types.Unset:
|
||||
el.append(toxml(attrdef.datatype, attrdef.name,
|
||||
attrvalue))
|
||||
else:
|
||||
el.text = six.text_type(value)
|
||||
return el
|
||||
|
Loading…
Reference in New Issue
Block a user