mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-23 19:19:53 +00:00
Ensure that item fields have the proper type.
The item fields were not setting their type based on the reported field's type attribute, so values were not being encoded properly. Fixes issue #121
This commit is contained in:
parent
fc8a13df5a
commit
9c6dde5d22
1 changed files with 3 additions and 3 deletions
|
@ -96,11 +96,11 @@ class Form(ElementBase):
|
|||
self.xml.append(itemXML)
|
||||
reported_vars = self['reported'].keys()
|
||||
for var in reported_vars:
|
||||
fieldXML = ET.Element('{%s}field' % FormField.namespace)
|
||||
itemXML.append(fieldXML)
|
||||
field = FormField(xml=fieldXML)
|
||||
field = FormField()
|
||||
field._type = self['reported'][var]['type']
|
||||
field['var'] = var
|
||||
field['value'] = values.get(var, None)
|
||||
itemXML.append(field.xml)
|
||||
|
||||
def add_reported(self, var, ftype=None, label='', desc='', **kwargs):
|
||||
kwtype = kwargs.get('type', None)
|
||||
|
|
Loading…
Reference in a new issue