diff --git a/src/qgis_geonode/styles.py b/src/qgis_geonode/styles.py index 4759c09..3cc0b9e 100644 --- a/src/qgis_geonode/styles.py +++ b/src/qgis_geonode/styles.py @@ -4,7 +4,7 @@ from qgis.PyQt import QtXml from . import network -from .utils import remove_sld_comments +from .utils import remove_comments_from_sld def deserialize_sld_doc( @@ -22,7 +22,7 @@ def deserialize_sld_doc( # We remove all the comments from the SLD since they cause a QGIS crash # during the SLD serialization (serialize_sld_named_layer, save() method) - remove_sld_comments(root) + remove_comments_from_sld(root) if not root.isNull(): sld_named_layer = root.firstChildElement("NamedLayer") diff --git a/src/qgis_geonode/utils.py b/src/qgis_geonode/utils.py index f29635f..2298e62 100644 --- a/src/qgis_geonode/utils.py +++ b/src/qgis_geonode/utils.py @@ -39,12 +39,12 @@ def show_message( message_bar.pushWidget(message_item, level=level) -def remove_sld_comments(element): +def remove_comments_from_sld(element): child = element.firstChild() while not child.isNull(): if child.isComment(): element.removeChild(child) else: if child.isElement(): - remove_sld_comments(child) + remove_comments_from_sld(child) child = child.nextSibling()