Skip to content

Commit

Permalink
Fix for xml metadata utilities
Browse files Browse the repository at this point in the history
- Allow to fail gracefully if the metadata structure is not expected
  • Loading branch information
lucernae committed Sep 15, 2017
1 parent 0c36c84 commit 9064c11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geonode/qgis_server/xml_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ def insert_xml_element(root, element_path):
element = root.find(path, XML_NS)
if element is None:
# if a parent is missing insert it at the right place
element = ElementTree.SubElement(parent, tag)
try:
element = ElementTree.SubElement(parent, tag)
except:
# In some cases we can't add parent because the tag name is
# not specific
pass
parent = element
return element

Expand Down

0 comments on commit 9064c11

Please sign in to comment.