mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Return '' instead of None from form fields with no values.
This commit is contained in:
parent
961668d420
commit
62230fc970
1 changed files with 3 additions and 1 deletions
|
@ -85,7 +85,7 @@ class FormField(ElementBase):
|
||||||
return None
|
return None
|
||||||
elif self._type == 'boolean':
|
elif self._type == 'boolean':
|
||||||
return valsXML[0].text in self.true_values
|
return valsXML[0].text in self.true_values
|
||||||
elif self._type in self.multi_value_types:
|
elif self._type in self.multi_value_types or len(valsXML) > 1:
|
||||||
values = []
|
values = []
|
||||||
for valXML in valsXML:
|
for valXML in valsXML:
|
||||||
if valXML.text is None:
|
if valXML.text is None:
|
||||||
|
@ -95,6 +95,8 @@ class FormField(ElementBase):
|
||||||
values = "\n".join(values)
|
values = "\n".join(values)
|
||||||
return values
|
return values
|
||||||
else:
|
else:
|
||||||
|
if valsXML[0].text is None:
|
||||||
|
return ''
|
||||||
return valsXML[0].text
|
return valsXML[0].text
|
||||||
|
|
||||||
def set_answer(self, answer):
|
def set_answer(self, answer):
|
||||||
|
|
Loading…
Reference in a new issue