do not fail on forms without category
This commit is contained in:
parent
9cc48f4cf9
commit
140867e505
|
@ -17,7 +17,8 @@ pub._set_request(wcs.qommon.http_request.HTTPRequest(None, {}))
|
|||
pub.get_request().environ['SCRIPT_NAME'] = ''
|
||||
|
||||
xml = ET.parse(sys.argv[1]).getroot()
|
||||
xml.remove([x for x in xml.getchildren() if x.tag == 'category'][0])
|
||||
if [x for x in xml.getchildren() if x.tag == 'category']:
|
||||
xml.remove([x for x in xml.getchildren() if x.tag == 'category'][0])
|
||||
formdef = wcs.formdef.FormDef.import_from_xml_tree(xml, charset='utf-8')
|
||||
wcs_admin_page = LocalFormDefPage(formdef)
|
||||
print wcs_admin_page.get_preview()
|
||||
|
|
Reference in New Issue