forked from sch/Rivista
Python: Fix an error upon iterating for elements of type category (Thank you roughnecks).
This commit is contained in:
parent
8ab7396a36
commit
a9c7832da1
1 changed files with 3 additions and 3 deletions
|
@ -325,9 +325,9 @@ def generate_atom(iq, link):
|
|||
categories = item_payload.find(namespace + 'category')
|
||||
if isinstance(categories, ET.Element):
|
||||
for category in item_payload.findall(namespace + 'category'):
|
||||
if not 'term' in category.attrib and not category.attrib['term']: continue
|
||||
category_term = category.attrib['term']
|
||||
ET.SubElement(e_entry, 'category', {'term': category_term})
|
||||
if 'term' in category.attrib and category.attrib['term']:
|
||||
category_term = category.attrib['term']
|
||||
ET.SubElement(e_entry, 'category', {'term': category_term})
|
||||
|
||||
|
||||
identifier = item_payload.find(namespace + 'id')
|
||||
|
|
Loading…
Reference in a new issue