diff --git a/g3w-admin/qdjango/utils/data.py b/g3w-admin/qdjango/utils/data.py index 1b447a963..99c69faa0 100644 --- a/g3w-admin/qdjango/utils/data.py +++ b/g3w-admin/qdjango/utils/data.py @@ -388,11 +388,28 @@ def _getDataVectorjoins(self): # get root of layer-tree-group ret = [] + try: vectorjoins = self.qgs_layer.vectorJoins() + except: + vectorjoins = [] - for order, join in enumerate(vectorjoins): + for order, join in enumerate(vectorjoins): + try: + ''' + Sometimes the the vectorjoins layer section ina QGIS project can contains old 'ghost' joins, i.e.: + + + + + The layer Sommarioni_Clauzetto_5c2f9be3_2266_4760_8840_165618815314 is not present inside the project, + may be it is a old layer removed from the project. + ''' # Prefix management if layer_tree_vectorjoins[order].get("hasCustomPrefix") == "1": @@ -418,8 +435,8 @@ def _getDataVectorjoins(self): # For join 1to1 self.qgisProject.relation_1to1_layers.append(self.layerId) - except: - pass + except: + pass return ret def _getDataCapabilities(self):