Skip to content

Commit

Permalink
Fix crash when parsing atlas settings if coverageLayerSource is not a…
Browse files Browse the repository at this point in the history
… postgres DB
  • Loading branch information
manisandro committed Feb 14, 2025
1 parent 2446cf2 commit 7028c78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/config_generator/qgs_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ def print_templates(self):

atlas = template.find("Atlas")
if atlas is not None and atlas.get("enabled") == "1":
atlasLayer = atlas.get('coverageLayerName')
print_template['atlasCoverageLayer'] = self.__lookup_short_name(atlasLayer)
print_template['atlas_pk'] = self.__table_metadata(atlas.get('coverageLayerSource'))['primary_key']
tableMetadata = self.__table_metadata(atlas.get('coverageLayerSource'))
if 'primary_key' in tableMetadata:
atlasLayer = atlas.get('coverageLayerName')
print_template['atlasCoverageLayer'] = self.__lookup_short_name(atlasLayer)
print_template['atlas_pk'] = tableMetadata['primary_key']

labels = []
for label in template.findall(".//LayoutItem[@type='65641']"):
Expand Down

0 comments on commit 7028c78

Please # to comment.