diff --git a/pubsub_to_atom.py b/pubsub_to_atom.py index 39ce383..d2261be 100644 --- a/pubsub_to_atom.py +++ b/pubsub_to_atom.py @@ -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')