XEP-0004: stanza, only delete field type if it is not 'hidden'
Not strictly required, but most XEPs use it like that for forms of type='submit', and that makes it easier to write stanza tests.
This commit is contained in:
parent
cb83ebe32c
commit
30b1d27fc1
@ -48,6 +48,7 @@ class Form(ElementBase):
|
|||||||
fields = self.get_fields()
|
fields = self.get_fields()
|
||||||
for var in fields:
|
for var in fields:
|
||||||
field = fields[var]
|
field = fields[var]
|
||||||
|
if field['type'] != 'hidden':
|
||||||
del field['type']
|
del field['type']
|
||||||
del field['label']
|
del field['label']
|
||||||
del field['desc']
|
del field['desc']
|
||||||
@ -74,6 +75,7 @@ class Form(ElementBase):
|
|||||||
for option in options:
|
for option in options:
|
||||||
field.add_option(**option)
|
field.add_option(**option)
|
||||||
else:
|
else:
|
||||||
|
if field['type'] != 'hidden':
|
||||||
del field['type']
|
del field['type']
|
||||||
self.append(field)
|
self.append(field)
|
||||||
return field
|
return field
|
||||||
|
Loading…
Reference in New Issue
Block a user