Skip to content

Commit

Permalink
Fix join1:1 with empty prefix (#902) (#908)
Browse files Browse the repository at this point in the history
* Fix prefix management

* Typo

---------

Co-authored-by: wlorenzetti <lorenzett@gis3w.it>
(cherry picked from commit bf673a3)

Co-authored-by: Walter Lorenzetti <lorenzetti@gis3w.it>
  • Loading branch information
github-actions[bot] and wlorenzetti authored Jul 23, 2024
1 parent 332f96d commit 27c98ad
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions g3w-admin/qdjango/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,20 +391,14 @@ def _getDataVectorjoins(self):
try:
vectorjoins = self.qgs_layer.vectorJoins()



for order, join in enumerate(vectorjoins):


# Prefix management
# If sert custom prefix and the value is '', continue for cycle to avoid relation save
if layer_tree_vectorjoins[order].get('hasCustomPrefix') == '1' and join.prefix() == '':
continue
if layer_tree_vectorjoins[order].get("hasCustomPrefix") == "1":
prefix = join.prefix()
else:
if layer_tree_vectorjoins[order].get("hasCustomPrefix") == "1":
prefix = join.prefix()
else:
prefix = f"{join.joinLayer().name()}_"

prefix = f"{join.joinLayer().name()}_"

ret.append(
{
Expand Down Expand Up @@ -1023,7 +1017,7 @@ def __init__(self, qgis_file, **kwargs):

self.closeProject(**kwargs)

# register defaul validator
# register default validator
for validator in self._defaultValidators:
self.registerValidator(validator)

Expand Down

0 comments on commit 27c98ad

Please sign in to comment.