Allow passing form instructions as a list of strings.

This commit is contained in:
Lance Stout 2012-10-18 12:27:53 -07:00
parent af9632519c
commit 63b58edda1

View file

@ -201,7 +201,8 @@ class Form(ElementBase):
del self['instructions']
if instructions in [None, '']:
return
instructions = instructions.split('\n')
if not isinstance(instructions, list):
instructions = instructions.split('\n')
for instruction in instructions:
inst = ET.Element('{%s}instructions' % self.namespace)
inst.text = instruction