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')
|
categories = item_payload.find(namespace + 'category')
|
||||||
if isinstance(categories, ET.Element):
|
if isinstance(categories, ET.Element):
|
||||||
for category in item_payload.findall(namespace + 'category'):
|
for category in item_payload.findall(namespace + 'category'):
|
||||||
if not 'term' in category.attrib and not category.attrib['term']: continue
|
if 'term' in category.attrib and category.attrib['term']:
|
||||||
category_term = category.attrib['term']
|
category_term = category.attrib['term']
|
||||||
ET.SubElement(e_entry, 'category', {'term': category_term})
|
ET.SubElement(e_entry, 'category', {'term': category_term})
|
||||||
|
|
||||||
|
|
||||||
identifier = item_payload.find(namespace + 'id')
|
identifier = item_payload.find(namespace + 'id')
|
||||||
|
|
Loading…
Reference in a new issue